Removed commented out code

This commit is contained in:
Jasmina Malicevic
2022-04-26 16:24:38 +02:00
parent abfc780202
commit 4e6d38030c
2 changed files with 4 additions and 19 deletions

View File

@@ -103,10 +103,9 @@ func NewBlockPool(
) *BlockPool {
bp := &BlockPool{
logger: logger,
peers: make(map[types.NodeID]*bpPeer),
requesters: make(map[int64]*bpRequester),
// verificationRequesters: make(map[int64]*bpRequester),
logger: logger,
peers: make(map[types.NodeID]*bpPeer),
requesters: make(map[int64]*bpRequester),
height: start,
startHeight: start,
numPending: 0,
@@ -260,10 +259,6 @@ func (pool *BlockPool) PopRequest() {
} else {
panic(fmt.Sprintf("Expected requester to pop, got nothing at height %v", pool.height))
}
// if r := pool.verificationRequesters[pool.height]; r != nil {
// r.Stop()
// delete(pool.verificationRequesters, pool.height)
// }
}
// RedoRequest invalidates the block at pool.height,
@@ -376,12 +371,6 @@ func (pool *BlockPool) removePeer(peerID types.NodeID) {
}
}
// for _, requester := range pool.verificationRequesters {
// if requester.getPeerID() == peerID {
// requester.redo(peerID)
// }
// }
peer, ok := pool.peers[peerID]
if ok {
if peer.timeout != nil {

View File

@@ -274,7 +274,6 @@ func TestReactor_SyncTime(t *testing.T) {
require.Eventually(
t,
func() bool {
//t.Logf("%d %d %s", rts.reactors[rts.nodes[1]].pool.height, rts.reactors[rts.nodes[0]].pool.height, rts.reactors[rts.nodes[1]].GetRemainingSyncTime())
return rts.reactors[rts.nodes[1]].GetRemainingSyncTime() > time.Nanosecond &&
rts.reactors[rts.nodes[1]].pool.getLastSyncRate() > 0.001
},
@@ -315,10 +314,7 @@ func TestReactor_NoBlockResponse(t *testing.T) {
secondaryPool := rts.reactors[rts.nodes[1]].pool
require.Eventually(
t,
func() bool {
t.Logf("%d %d", secondaryPool.MaxPeerHeight(), secondaryPool.height)
return secondaryPool.MaxPeerHeight() > 0 && secondaryPool.IsCaughtUp()
},
func() bool { return secondaryPool.MaxPeerHeight() > 0 && secondaryPool.IsCaughtUp() },
10*time.Second,
10*time.Millisecond,
"expected node to be fully synced",