Bump nim-eth: Add closeWait to EthereumNode (#1742)

This commit is contained in:
andri lim 2023-09-09 13:54:58 +07:00 committed by GitHub
parent db6bd9af16
commit 948c94763c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 12 deletions

View File

@ -91,7 +91,7 @@ proc newEngineEnv*(conf: var NimbusConf, chainFile: string, enableAuth: bool): E
echo error
quit(QuitFailure)
var
let
node = setupEthNode(conf, ctx)
com = makeCom(conf)
chain = newChain(com)
@ -152,13 +152,9 @@ proc newEngineEnv*(conf: var NimbusConf, chainFile: string, enableAuth: bool): E
client : client,
sync : sync
)
proc close(node: EthereumNode) =
node.stopListening()
waitFor node.listeningServer.closeWait()
proc close*(env: EngineEnv) =
env.node.close()
waitFor env.node.closeWait()
env.sync.stop()
waitFor env.client.close()
waitFor env.sealer.stop()

View File

@ -22,7 +22,7 @@ import
# ------------------------------------------------------------------------------
proc setEthHandlerNewBlocksAndHashes*(
node: var EthereumNode;
node: EthereumNode;
blockHandler: NewBlockHandler;
hashesHandler: NewBlockHashesHandler;
arg: pointer;
@ -32,7 +32,7 @@ proc setEthHandlerNewBlocksAndHashes*(
w.setNewBlockHashesHandler(hashesHandler, arg)
proc addEthHandlerCapability*(
node: var EthereumNode;
node: EthereumNode;
peerPool: PeerPool;
chain: ChainRef;
txPool = TxPoolRef(nil);
@ -48,11 +48,11 @@ proc addEthHandlerCapability*(
# ------------------------------------------------------------------------------
when dbBackend != select_backend.none:
import
import
./snap as handlers_snap
proc addSnapHandlerCapability*(
node: var EthereumNode;
node: EthereumNode;
peerPool: PeerPool;
chain = ChainRef(nil);
) =

2
vendor/nim-eth vendored

@ -1 +1 @@
Subproject commit 0d7e7448c4a2a50136e726be7d4e4a38e094e8e3
Subproject commit ac680ed79bf9e4e78ca14a001eb7f78acdf7b07d