Added Block Hash Output

This commit is contained in:
ahmedbodi 2013-12-19 12:04:04 +00:00
parent 02755dbb6a
commit 4f5388f715

View File

@ -43,11 +43,12 @@ class BitcoinRPC(object):
def submitblock(self, block_hex, block_hash_hex): def submitblock(self, block_hex, block_hash_hex):
# Try submitblock if that fails, go to getblocktemplate # Try submitblock if that fails, go to getblocktemplate
try: try:
print("Submitting Block with Submit Block ") log.info("Submitting Block with Submit Block ")
log.info("Block Hash: %s" [block_hex,])
resp = (yield self._call('submitblock', [block_hex,])) resp = (yield self._call('submitblock', [block_hex,]))
except Exception: except Exception:
try: try:
print("Submit Block call failed, trying GetBlockTemplate") log.exception "Submit Block call failed, trying GetBlockTemplate")
resp = (yield self._call('getblocktemplate', [{'mode': 'submit', 'data': block_hex}])) resp = (yield self._call('getblocktemplate', [{'mode': 'submit', 'data': block_hex}]))
except Exception as e: except Exception as e:
log.exception("Both SubmitBlock and GetBlockTemplate failed. Problem Submitting block %s" % str(e)) log.exception("Both SubmitBlock and GetBlockTemplate failed. Problem Submitting block %s" % str(e))