fix mempool conflicts following cancelled api calls that send transactions with the blocking flag

This commit is contained in:
Jack Robison 2020-06-05 20:06:08 -04:00
parent ae53062518
commit 872b89ee93
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2

View file

@ -300,11 +300,8 @@ class WalletManager:
async def broadcast_or_release(self, tx, blocking=False): async def broadcast_or_release(self, tx, blocking=False):
try: try:
await self.ledger.broadcast(tx) await self.ledger.broadcast(tx)
if blocking:
await self.ledger.wait(tx, timeout=None)
except CodeMessageError as err:
log.warning("transaction rejected, leaving reserved")
raise
except: except:
await self.ledger.release_tx(tx) await self.ledger.release_tx(tx)
raise raise
if blocking:
await self.ledger.wait(tx, timeout=None)