diff --git a/joinmarket/blockchaininterface.py b/joinmarket/blockchaininterface.py index 0eea8820..8725ddfc 100644 --- a/joinmarket/blockchaininterface.py +++ b/joinmarket/blockchaininterface.py @@ -13,6 +13,7 @@ import time import urllib import urllib2 +import traceback from decimal import Decimal import bitcoin as btc @@ -335,12 +336,13 @@ def run(self): def pushtx(self, txhex): try: json_str = btc.blockr_pushtx(txhex, self.network) + data = json.loads(json_str) + if data['status'] != 'success': + log.debug(data) + return False except Exception: log.debug('failed blockr.io pushtx') - return False - data = json.loads(json_str) - if data['status'] != 'success': - log.debug(data) + log.debug(traceback.format_exc()) return False return True diff --git a/joinmarket/maker.py b/joinmarket/maker.py index eaa363f8..df48e2ec 100644 --- a/joinmarket/maker.py +++ b/joinmarket/maker.py @@ -266,10 +266,10 @@ def on_seen_tx(self, nick, txhex): def on_push_tx(self, nick, txhex): log.debug('received txhex from ' + nick + ' to push\n' + txhex) pushed = jm_single().bc_interface.pushtx(txhex) - if pushed[0]: - log.debug('pushed tx ' + str(pushed[1])) + if pushed: + log.debug('pushed tx ' + btc.txhash(txhex)) else: - log.debug('failed to push tx, reason: '+str(pushed[1])) + log.debug('failed to push tx sent by taker') self.msgchan.send_error(nick, 'Unable to push tx') def on_welcome(self): diff --git a/sendpayment.py b/sendpayment.py index 7cffa4b8..a131e5f2 100644 --- a/sendpayment.py +++ b/sendpayment.py @@ -127,6 +127,7 @@ def finishcallback(self, coinjointx): else: #Error should be in log, will not retry. log.debug('failed to push tx, ending.') + time.sleep(10) # see github issue #516 self.taker.msgchan.shutdown() return self.ignored_makers += coinjointx.nonrespondants