DAS: code cleanup - variables

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
This commit is contained in:
Csaba Kiraly 2023-06-12 16:16:50 +02:00
parent 660118684c
commit c768586eb4
No known key found for this signature in database
GPG Key ID: 0FE274EE8C95166E
1 changed files with 4 additions and 12 deletions

View File

@ -109,20 +109,12 @@ when isMainModule:
assert(log2(blocksize.float).ceil.int <= segmentsize * 8 )
var
rng: ref HmacDrbgContext
nodes: seq[(discv5_protocol.Protocol, PrivateKey)]
node0: discv5_protocol.Protocol
privKey0: PrivateKey
signedPeerRec0: SignedPeerRecord
peerRec0: PeerRecord
segmentIDs = newSeq[NodeId](blocksize)
# start network
rng = newRng()
nodes = await bootstrapNetwork(nodecount=nodecount, delay=delay_pernode)
(node0, privKey0) = nodes[0]
signedPeerRec0 = privKey0.toSignedPeerRecord
peerRec0 = signedPeerRec0.data
let
rng = newRng()
nodes = await bootstrapNetwork(nodecount=nodecount, delay=delay_pernode)
# wait for network to settle
await sleepAsync(chronos.milliseconds(delay_init))
@ -138,7 +130,7 @@ when isMainModule:
segmentIDs[s] = key
futs.add(node0.addValue(key, segment))
futs.add(nodes[0][0].addValue(key, segment))
let pass = await allFutures(futs).withTimeout(upload_timeout)
info "uploaded to DHT", by = 0, pass, time = Moment.now() - startTime