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
|
address = e.address
|
||||||
wantType = $e.wantType
|
wantType = $e.wantType
|
||||||
|
|
||||||
if idx < 0: # updating entry
|
if idx < 0: # new entry
|
||||||
|
peerCtx.peerWants.add(e)
|
||||||
let
|
let
|
||||||
have = await e.address in b.localStore
|
have = await e.address in b.localStore
|
||||||
price = @(
|
price = @(
|
||||||
|
@ -424,9 +425,8 @@ proc wantListHandler*(
|
||||||
`type`: BlockPresenceType.Have,
|
`type`: BlockPresenceType.Have,
|
||||||
price: price))
|
price: price))
|
||||||
elif e.wantType == WantType.WantBlock:
|
elif e.wantType == WantType.WantBlock:
|
||||||
peerCtx.peerWants.add(e)
|
|
||||||
codex_block_exchange_want_block_lists_received.inc()
|
codex_block_exchange_want_block_lists_received.inc()
|
||||||
else:
|
else: # update existing entry
|
||||||
# peer doesn't want this block anymore
|
# peer doesn't want this block anymore
|
||||||
if e.cancel:
|
if e.cancel:
|
||||||
peerCtx.peerWants.del(idx)
|
peerCtx.peerWants.del(idx)
|
||||||
|
|
Loading…
Reference in New Issue