-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cleanup blockexchange blockAddress handling #1051
base: master
Are you sure you want to change the base?
Conversation
afbfadb
to
af0c9d8
Compare
3e706b3
to
8318eac
Compare
toSeq(b.pendingBlocks.wantListCids) | ||
.filter do(cid: Cid) -> bool: | ||
not b.peers.anyIt( cid in it.peerHaveCids )) | ||
toSeq(b.pendingBlocks.wantList).filterIt(b.peers.peersHave(it).len == 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm trusting those two things are the same....
@@ -130,19 +130,6 @@ iterator wantList*(p: PendingBlocksManager): BlockAddress = | |||
for a in p.blocks.keys: | |||
yield a | |||
|
|||
iterator wantListBlockCids*(p: PendingBlocksManager): Cid = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this is the actual dead code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, unused code.
@@ -38,12 +38,6 @@ type | |||
proc peerHave*(self: BlockExcPeerCtx): seq[BlockAddress] = | |||
toSeq(self.blocks.keys) | |||
|
|||
proc peerHaveCids*(self: BlockExcPeerCtx): HashSet[Cid] = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, LGTM
The use of CIDs and BlockAddresses in this part of the code could use a little clean-up. Some of this is unused code, left-over from the announce-every-block days. Some of the code can be easily made redundant by concolidating some knowledge where possible. Every little bit we clean up, we don't have to carry forward and maintain.