mirror of https://github.com/status-im/nim-eth.git
Fix PoW to be specifically uint64 as it is a float64 value that is being passed
This commit is contained in:
parent
abbeeb71b7
commit
a514db1427
|
@ -153,7 +153,7 @@ p2pProtocol Waku(version = wakuVersion,
|
||||||
wakuPeer = peer.state
|
wakuPeer = peer.state
|
||||||
|
|
||||||
let m = await peer.status(wakuVersion,
|
let m = await peer.status(wakuVersion,
|
||||||
cast[uint](wakuNet.config.powRequirement),
|
cast[uint64](wakuNet.config.powRequirement),
|
||||||
@(wakuNet.config.bloom),
|
@(wakuNet.config.bloom),
|
||||||
wakuNet.config.isLightNode,
|
wakuNet.config.isLightNode,
|
||||||
wakuNet.config.wakuMode,
|
wakuNet.config.wakuMode,
|
||||||
|
@ -206,7 +206,7 @@ p2pProtocol Waku(version = wakuVersion,
|
||||||
handshake:
|
handshake:
|
||||||
proc status(peer: Peer,
|
proc status(peer: Peer,
|
||||||
protocolVersion: uint,
|
protocolVersion: uint,
|
||||||
powConverted: uint,
|
powConverted: uint64,
|
||||||
bloom: Bytes,
|
bloom: Bytes,
|
||||||
isLightNode: bool,
|
isLightNode: bool,
|
||||||
wakuMode: WakuMode,
|
wakuMode: WakuMode,
|
||||||
|
@ -251,7 +251,7 @@ p2pProtocol Waku(version = wakuVersion,
|
||||||
# notify filters of this message
|
# notify filters of this message
|
||||||
peer.networkState.filters.notify(msg)
|
peer.networkState.filters.notify(msg)
|
||||||
|
|
||||||
proc powRequirement(peer: Peer, value: uint) =
|
proc powRequirement(peer: Peer, value: uint64) =
|
||||||
if not peer.state.initialized:
|
if not peer.state.initialized:
|
||||||
warn "Handshake not completed yet, discarding powRequirement"
|
warn "Handshake not completed yet, discarding powRequirement"
|
||||||
return
|
return
|
||||||
|
@ -479,7 +479,7 @@ proc setPowRequirement*(node: EthereumNode, powReq: float64) {.async.} =
|
||||||
node.protocolState(Waku).config.powRequirement = powReq
|
node.protocolState(Waku).config.powRequirement = powReq
|
||||||
var futures: seq[Future[void]] = @[]
|
var futures: seq[Future[void]] = @[]
|
||||||
for peer in node.peers(Waku):
|
for peer in node.peers(Waku):
|
||||||
futures.add(peer.powRequirement(cast[uint](powReq)))
|
futures.add(peer.powRequirement(cast[uint64](powReq)))
|
||||||
|
|
||||||
# Exceptions from sendMsg will not be raised
|
# Exceptions from sendMsg will not be raised
|
||||||
await allFutures(futures)
|
await allFutures(futures)
|
||||||
|
|
|
@ -116,7 +116,7 @@ p2pProtocol Whisper(version = whisperVersion,
|
||||||
whisperPeer = peer.state
|
whisperPeer = peer.state
|
||||||
|
|
||||||
let m = await peer.status(whisperVersion,
|
let m = await peer.status(whisperVersion,
|
||||||
cast[uint](whisperNet.config.powRequirement),
|
cast[uint64](whisperNet.config.powRequirement),
|
||||||
@(whisperNet.config.bloom),
|
@(whisperNet.config.bloom),
|
||||||
whisperNet.config.isLightNode,
|
whisperNet.config.isLightNode,
|
||||||
timeout = chronos.milliseconds(500))
|
timeout = chronos.milliseconds(500))
|
||||||
|
@ -154,7 +154,7 @@ p2pProtocol Whisper(version = whisperVersion,
|
||||||
handshake:
|
handshake:
|
||||||
proc status(peer: Peer,
|
proc status(peer: Peer,
|
||||||
protocolVersion: uint,
|
protocolVersion: uint,
|
||||||
powConverted: uint,
|
powConverted: uint64,
|
||||||
bloom: Bytes,
|
bloom: Bytes,
|
||||||
isLightNode: bool)
|
isLightNode: bool)
|
||||||
|
|
||||||
|
@ -197,7 +197,7 @@ p2pProtocol Whisper(version = whisperVersion,
|
||||||
# notify filters of this message
|
# notify filters of this message
|
||||||
peer.networkState.filters.notify(msg)
|
peer.networkState.filters.notify(msg)
|
||||||
|
|
||||||
proc powRequirement(peer: Peer, value: uint) =
|
proc powRequirement(peer: Peer, value: uint64) =
|
||||||
if not peer.state.initialized:
|
if not peer.state.initialized:
|
||||||
warn "Handshake not completed yet, discarding powRequirement"
|
warn "Handshake not completed yet, discarding powRequirement"
|
||||||
return
|
return
|
||||||
|
@ -405,7 +405,7 @@ proc setPowRequirement*(node: EthereumNode, powReq: float64) {.async.} =
|
||||||
node.protocolState(Whisper).config.powRequirement = powReq
|
node.protocolState(Whisper).config.powRequirement = powReq
|
||||||
var futures: seq[Future[void]] = @[]
|
var futures: seq[Future[void]] = @[]
|
||||||
for peer in node.peers(Whisper):
|
for peer in node.peers(Whisper):
|
||||||
futures.add(peer.powRequirement(cast[uint](powReq)))
|
futures.add(peer.powRequirement(cast[uint64](powReq)))
|
||||||
|
|
||||||
# Exceptions from sendMsg will not be raised
|
# Exceptions from sendMsg will not be raised
|
||||||
await allFutures(futures)
|
await allFutures(futures)
|
||||||
|
|
Loading…
Reference in New Issue