Skip to content
This repository has been archived by the owner on Feb 1, 2023. It is now read-only.

Send cancel to peer when Session.GetBlock() is cancelled #253

Closed
dirkmc opened this issue Feb 10, 2020 · 2 comments
Closed

Send cancel to peer when Session.GetBlock() is cancelled #253

dirkmc opened this issue Feb 10, 2020 · 2 comments
Labels
kind/bug A bug in existing code (including security flaws)

Comments

@dirkmc
Copy link
Contributor

dirkmc commented Feb 10, 2020

If a client calls Session.GetBlock() or Session.GetBlocks() and then cancels the context, and the want has been sent to the peer, we should send a cancel to the peer.

Currently we only remove the want from the pending wants (ie wants that have not yet been sent to the peer).

Note that we need to make sure that no other session wants the same block before we send a cancel. We should be able to check that by asking the SessionInterestManager.

@dirkmc dirkmc added the kind/bug A bug in existing code (including security flaws) label Feb 10, 2020
@Stebalien
Copy link
Member

Could we reference count wants in the local wantlist?

@Stebalien
Copy link
Member

Ah, nevermind. The interest cache is ref-counted anyways.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug A bug in existing code (including security flaws)
Projects
None yet
Development

No branches or pull requests

2 participants