mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 21:56:43 +00:00
p2p/discover: fix timeout on refresh if no bootnodes
If we have no nodes to add in a refresh, and the table is empty, it is useless to do lookups. This was triggering a 3 second wait for a timeout in the initialization code, making some hive tests fail. Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
This commit is contained in:
parent
25cce4dfe4
commit
fb4dff44dc
1 changed files with 6 additions and 0 deletions
|
|
@ -428,6 +428,12 @@ func (tab *Table) doRefresh(done chan struct{}) {
|
||||||
// (hopefully) still alive.
|
// (hopefully) still alive.
|
||||||
tab.loadSeedNodes()
|
tab.loadSeedNodes()
|
||||||
|
|
||||||
|
// If the table is empty, we cannot perform any lookups.
|
||||||
|
if tab.len() == 0 {
|
||||||
|
log.Debug("doRefresh called, but no nodes to start from")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// Run self lookup to discover new neighbor nodes.
|
// Run self lookup to discover new neighbor nodes.
|
||||||
tab.net.lookupSelf()
|
tab.net.lookupSelf()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue