Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 862a7b0

Browse files
authored
Merge pull request #1779 from achamely/master
update pending insert
2 parents bc0b343 + 5870861 commit 862a7b0

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

api/pending.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,19 @@ def insertpending(txhex):
1111
return
1212

1313
if 'BTC' in rawtx:
14-
#handle btc pending amounts
15-
insertbtc(rawtx)
14+
try:
15+
#handle btc pending amounts
16+
insertbtc(rawtx)
17+
except Exception,e:
18+
print "error inserting btc", e, "\n Could notinsert rawtx", rawtx
19+
20+
error_strings = ["No Omni Layer Protocol transaction","Error in omni_decodetransaction"]
21+
if 'MP' in rawtx and not any(x in rawtx['MP'] for x in error_strings):
22+
try:
23+
insertomni(rawtx)
24+
except Exception,e:
25+
print "error inserting omni", e, "\n Could notinsert rawtx", rawtx
1626

17-
if 'MP' in rawtx and 'Not a Master Protocol transaction' not in rawtx['MP']: #('amount' in rawtx['MP'] and decimal.Decimal(rawtx['MP']['amount'])>0) or 'unitprice' in rawtx['MP']:
18-
#only run if we have a non zero positive amount to process, otherwise exit
19-
insertomni(rawtx)
2027

2128
def insertbtc(rawtx):
2229
try:

0 commit comments

Comments
 (0)