mirror of
https://github.com/logos-storage/nim-ethers.git
synced 2026-01-08 16:43:09 +00:00
Ignore errors when retrieving block by hash
This commit is contained in:
parent
76bd3090d1
commit
0aea16047c
@ -132,8 +132,11 @@ method subscribeBlocks(subscriptions: PollingSubscriptions,
|
|||||||
{.async.} =
|
{.async.} =
|
||||||
|
|
||||||
proc getBlock(hash: BlockHash) {.async.} =
|
proc getBlock(hash: BlockHash) {.async.} =
|
||||||
if blck =? (await subscriptions.client.eth_getBlockByHash(hash, false)):
|
try:
|
||||||
await onBlock(blck)
|
if blck =? (await subscriptions.client.eth_getBlockByHash(hash, false)):
|
||||||
|
await onBlock(blck)
|
||||||
|
except CatchableError:
|
||||||
|
discard
|
||||||
|
|
||||||
proc callback(id, change: JsonNode) =
|
proc callback(id, change: JsonNode) =
|
||||||
if hash =? BlockHash.fromJson(change).catch:
|
if hash =? BlockHash.fromJson(change).catch:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user