mirror of
https://github.com/ipfs/kubo.git
synced 2025-07-02 03:28:25 +08:00
fix tests halting
This commit is contained in:
@ -117,6 +117,9 @@ func (bs *bitswap) GetBlocks(parent context.Context, ks []u.Key) (*blocks.Block,
|
||||
}
|
||||
|
||||
func (bs *bitswap) sendWantListTo(ctx context.Context, peers <-chan peer.Peer) error {
|
||||
if peers == nil {
|
||||
panic("Cant send wantlist to nil peerchan")
|
||||
}
|
||||
message := bsmsg.New()
|
||||
for _, wanted := range bs.wantlist.Keys() {
|
||||
message.AddWanted(wanted)
|
||||
@ -164,6 +167,7 @@ func (bs *bitswap) run(ctx context.Context) {
|
||||
for {
|
||||
select {
|
||||
case <-broadcastSignal:
|
||||
unsentKeys = 0
|
||||
wantlist := bs.wantlist.Keys()
|
||||
if len(wantlist) == 0 {
|
||||
continue
|
||||
|
@ -59,7 +59,7 @@ func (mr *MockRouter) FindProviders(ctx context.Context, key u.Key) ([]peer.Peer
|
||||
}
|
||||
|
||||
func (mr *MockRouter) FindPeer(ctx context.Context, pid peer.ID) (peer.Peer, error) {
|
||||
log.Debug("FindPeer: %s", pid)
|
||||
log.Debugf("FindPeer: %s", pid)
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user