mirror of
https://github.com/logos-storage/logos-storage-nim.git
synced 2026-05-08 20:39:46 +00:00
adds wants type
This commit is contained in:
parent
0da746de7c
commit
1875e6b0d6
@ -22,9 +22,9 @@ import pkg/presto
|
||||
import pkg/libp2p
|
||||
import pkg/metrics
|
||||
import pkg/stew/base10
|
||||
import pkg/stew/base58
|
||||
import pkg/stew/byteutils
|
||||
import pkg/confutils
|
||||
|
||||
import pkg/libp2p
|
||||
import pkg/libp2p/routing_record
|
||||
import pkg/codexdht/discv5/spr as spr
|
||||
@ -104,10 +104,20 @@ proc formatBlockExchangePeers(peers: OrderedTable[PeerId, BlockExcPeerCtx]): Jso
|
||||
"price": $presence.price
|
||||
})
|
||||
|
||||
let jwantsArray = newJArray()
|
||||
for want in peerContext.peerWants:
|
||||
jwantsArray.add(%*{
|
||||
"block": base58.encode(Base58, want.`block`),
|
||||
"priority": $want.priority,
|
||||
"cancel": $want.cancel,
|
||||
"wantType": $want.wantType,
|
||||
"sendDontHave": $want.sendDontHave
|
||||
})
|
||||
|
||||
jarray.add(%*{
|
||||
"peerid": $peerId,
|
||||
"hasBlocks": jblocksArray,
|
||||
"wants": $peerContext.peerWants.len,
|
||||
"wants": jwantsArray,
|
||||
"exchanged": $peerContext.exchanged,
|
||||
})
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user