diff --git a/codex/blockexchange/engine/engine.nim b/codex/blockexchange/engine/engine.nim index 41605660..4b050210 100644 --- a/codex/blockexchange/engine/engine.nim +++ b/codex/blockexchange/engine/engine.nim @@ -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)