Fixed zeroname_updater.py crashing underwindows with UTF8
For some reason windows doesn't like parsing namecoin domains with "weird" characters, so adding a try to catch exception stops a strange block crashing the script - instead it ignores and moves on. We just have to hope there doesn't happen to be a namecoin domain in a block with weird characters.
This commit is contained in:
parent
6155899893
commit
0fa87523fd
1 changed files with 8 additions and 5 deletions
|
@ -59,11 +59,14 @@ def processBlock(block_id):
|
|||
print "Checking %s tx" % len(block["tx"])
|
||||
updated = 0
|
||||
for tx in block["tx"]:
|
||||
transaction = rpc.getrawtransaction(tx, 1)
|
||||
for vout in transaction.get("vout",[]):
|
||||
if "scriptPubKey" in vout and "nameOp" in vout["scriptPubKey"] and "name" in vout["scriptPubKey"]["nameOp"]:
|
||||
name_op = vout["scriptPubKey"]["nameOp"]
|
||||
updated += processNameOp(name_op["name"].replace("d/", ""), name_op["value"])
|
||||
try:
|
||||
transaction = rpc.getrawtransaction(tx, 1)
|
||||
for vout in transaction.get("vout",[]):
|
||||
if "scriptPubKey" in vout and "nameOp" in vout["scriptPubKey"] and "name" in vout["scriptPubKey"]["nameOp"]:
|
||||
name_op = vout["scriptPubKey"]["nameOp"]
|
||||
updated += processNameOp(name_op["name"].replace("d/", ""), name_op["value"])
|
||||
except Exception, err:
|
||||
print "Error processing tx #%s %s" % (tx, err)
|
||||
print "Done in %.3fs (updated %s)." % (time.time()-s, updated)
|
||||
if updated:
|
||||
publish()
|
||||
|
|
Loading…
Reference in a new issue