network/bitvector: Multibit set/unset + string rep (#1530)

* network/bitvector: Multibit set/unset + string rep

* network/bitvector: Add code comments

* network/bitvector: Make Unset -> Set with bool false

* network/bitvector: Revert to Set/Unset

* network/stream: Update to new bitvector signature
This commit is contained in:
lash
2019-07-02 18:08:00 +02:00
committed by GitHub
parent b3f21ddbba
commit a6e64aea67
3 changed files with 102 additions and 4 deletions

View File

@@ -231,7 +231,7 @@ func (p *Peer) handleOfferedHashesMsg(ctx context.Context, req *OfferedHashesMsg
ctr++
// set the bit, so create a request
want.Set(i/HashSize, true)
want.Set(i / HashSize)
log.Trace("need data", "ref", fmt.Sprintf("%x", hash), "request", true)
// measure how long it takes before we mark chunks for retrieval, and actually send the request