mirror of
https://github.com/codex-storage/nim-ethers.git
synced 2025-01-10 03:15:43 +00:00
applies review comments
This commit is contained in:
parent
4642545309
commit
c0cc437aa2
@ -283,18 +283,17 @@ method subscribeLogs(subscriptions: PollingSubscriptions,
|
||||
method unsubscribe*(subscriptions: PollingSubscriptions,
|
||||
id: JsonNode)
|
||||
{.async.} =
|
||||
subscriptions.logFilters.del(id)
|
||||
subscriptions.callbacks.del(id)
|
||||
if subscriptions.subscriptionMapping.hasKey(id):
|
||||
let sub = subscriptions.subscriptionMapping[id]
|
||||
subscriptions.subscriptionMapping.del(id)
|
||||
try:
|
||||
try:
|
||||
subscriptions.logFilters.del(id)
|
||||
subscriptions.callbacks.del(id)
|
||||
if sub =? subscriptions.subscriptionMapping.?[id]:
|
||||
subscriptions.subscriptionMapping.del(id)
|
||||
discard await subscriptions.client.eth_uninstallFilter(sub)
|
||||
except CancelledError as e:
|
||||
raise e
|
||||
except CatchableError:
|
||||
# Ignore if uninstallation of the filter fails. If it's the last step in our
|
||||
# cleanup, then filter changes for this filter will no longer be polled so
|
||||
# if the filter continues to live on in geth for whatever reason then it
|
||||
# doesn't matter.
|
||||
discard
|
||||
except CancelledError as e:
|
||||
raise e
|
||||
except CatchableError:
|
||||
# Ignore if uninstallation of the filter fails. If it's the last step in our
|
||||
# cleanup, then filter changes for this filter will no longer be polled so
|
||||
# if the filter continues to live on in geth for whatever reason then it
|
||||
# doesn't matter.
|
||||
discard
|
||||
|
Loading…
x
Reference in New Issue
Block a user