Fixes issue where only wants of type block are stored in peerContext
This commit is contained in:
parent
d6b0de080c
commit
2a254601d9
|
@ -401,7 +401,8 @@ proc wantListHandler*(
|
|||
address = e.address
|
||||
wantType = $e.wantType
|
||||
|
||||
if idx < 0: # updating entry
|
||||
if idx < 0: # new entry
|
||||
peerCtx.peerWants.add(e)
|
||||
let
|
||||
have = await e.address in b.localStore
|
||||
price = @(
|
||||
|
@ -424,9 +425,8 @@ proc wantListHandler*(
|
|||
`type`: BlockPresenceType.Have,
|
||||
price: price))
|
||||
elif e.wantType == WantType.WantBlock:
|
||||
peerCtx.peerWants.add(e)
|
||||
codex_block_exchange_want_block_lists_received.inc()
|
||||
else:
|
||||
else: # update existing entry
|
||||
# peer doesn't want this block anymore
|
||||
if e.cancel:
|
||||
peerCtx.peerWants.del(idx)
|
||||
|
|
Loading…
Reference in New Issue