eth/filters, p2p/simulations: fix benchmarks (#23806)
Some benchmarks in eth/filters were not good: they weren't reproducible, relying on geth chaindata to be present. Another one was rejected because the receipt was lacking a backing transcation. The p2p simulation benchmark had a lot of the warnings below, due to the framework calling both Stop() and Close(). Apparently, the simulated adapter is the only implementation which has a Close(), and there is no need to call both Stop and Close on it.
This commit is contained in:
committed by
GitHub
parent
32150f8aa9
commit
31870a59ff
@ -22,7 +22,6 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"math/rand"
|
||||
"sync"
|
||||
"time"
|
||||
@ -695,12 +694,6 @@ func (net *Network) Shutdown() {
|
||||
if err := node.Stop(); err != nil {
|
||||
log.Warn("Can't stop node", "id", node.ID(), "err", err)
|
||||
}
|
||||
// If the node has the close method, call it.
|
||||
if closer, ok := node.Node.(io.Closer); ok {
|
||||
if err := closer.Close(); err != nil {
|
||||
log.Warn("Can't close node", "id", node.ID(), "err", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
close(net.quitc)
|
||||
}
|
||||
|
Reference in New Issue
Block a user