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):
try:
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:
await self.ledger.release_tx(tx)
raise
if blocking:
await self.ledger.wait(tx, timeout=None)