mirror of
https://github.com/logos-storage/nim-ethers.git
synced 2026-01-04 06:33:07 +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,
|
method unsubscribe*(subscriptions: PollingSubscriptions,
|
||||||
id: JsonNode)
|
id: JsonNode)
|
||||||
{.async.} =
|
{.async.} =
|
||||||
subscriptions.logFilters.del(id)
|
try:
|
||||||
subscriptions.callbacks.del(id)
|
subscriptions.logFilters.del(id)
|
||||||
if subscriptions.subscriptionMapping.hasKey(id):
|
subscriptions.callbacks.del(id)
|
||||||
let sub = subscriptions.subscriptionMapping[id]
|
if sub =? subscriptions.subscriptionMapping.?[id]:
|
||||||
subscriptions.subscriptionMapping.del(id)
|
subscriptions.subscriptionMapping.del(id)
|
||||||
try:
|
|
||||||
discard await subscriptions.client.eth_uninstallFilter(sub)
|
discard await subscriptions.client.eth_uninstallFilter(sub)
|
||||||
except CancelledError as e:
|
except CancelledError as e:
|
||||||
raise e
|
raise e
|
||||||
except CatchableError:
|
except CatchableError:
|
||||||
# Ignore if uninstallation of the filter fails. If it's the last step in our
|
# 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
|
# 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
|
# if the filter continues to live on in geth for whatever reason then it
|
||||||
# doesn't matter.
|
# doesn't matter.
|
||||||
discard
|
discard
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user