account release bugfix
This commit is contained in:
@@ -201,7 +201,7 @@ async def main():
|
||||
addr, inverted = mirror_pools[pool]
|
||||
log.debug(f'Mirrored {addr} {price}')
|
||||
except Exception as x:
|
||||
log.debug(f'Could not update {pool}: {x}')
|
||||
log.debug(f'Could not update {pool}: {x} {tx}')
|
||||
if tx is not None:
|
||||
tx.account.reset_nonce()
|
||||
tx.account.release()
|
||||
|
||||
@@ -81,6 +81,7 @@ def transact_wrapper(addr, name, func):
|
||||
account = await Account.acquire()
|
||||
if account is None:
|
||||
raise ValueError(f'No account to sign transaction {addr}.{name}()')
|
||||
try:
|
||||
await ct.sign(account)
|
||||
try:
|
||||
tx_id = await current_w3.get().eth.send_raw_transaction(ct.data)
|
||||
@@ -89,6 +90,8 @@ def transact_wrapper(addr, name, func):
|
||||
except Web3Exception as e:
|
||||
e.args += addr, name
|
||||
raise e
|
||||
finally:
|
||||
account.release()
|
||||
return f
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user