mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 18:32:23 +00:00
p2p/simulations: add snapshotLoadTimeout variable
This commit is contained in:
parent
cad2a699ea
commit
51ae79551d
1 changed files with 3 additions and 1 deletions
|
|
@ -707,6 +707,8 @@ func (net *Network) snapshot(addServices []string, removeServices []string) (*Sn
|
||||||
return snap, nil
|
return snap, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var snapshotLoadTimeout = 120 * time.Second
|
||||||
|
|
||||||
// Load loads a network snapshot
|
// Load loads a network snapshot
|
||||||
func (net *Network) Load(snap *Snapshot) error {
|
func (net *Network) Load(snap *Snapshot) error {
|
||||||
// Start nodes.
|
// Start nodes.
|
||||||
|
|
@ -814,7 +816,7 @@ func (net *Network) Load(snap *Snapshot) error {
|
||||||
// Wait until all connections from the snapshot are established.
|
// Wait until all connections from the snapshot are established.
|
||||||
case <-allConnected:
|
case <-allConnected:
|
||||||
// Make sure that we do not wait forever.
|
// Make sure that we do not wait forever.
|
||||||
case <-time.After(120 * time.Second):
|
case <-time.After(snapshotLoadTimeout):
|
||||||
return errors.New("snapshot connections not established")
|
return errors.New("snapshot connections not established")
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue