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