Wait for conection to peer before mining with CPU.
This commit is contained in:
parent
6dc257b8c8
commit
5f444ce000
1 changed files with 8 additions and 0 deletions
|
@ -270,6 +270,14 @@ out:
|
||||||
// Non-blocking select to fall through
|
// Non-blocking select to fall through
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Wait until there is a connection to at least one other peer
|
||||||
|
// since there is no way to relay a found block or receive
|
||||||
|
// transactions to work on when there are no connected peers.
|
||||||
|
if m.server.ConnectedCount() == 0 {
|
||||||
|
time.Sleep(time.Second)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
// No point in searching for a solution before the chain is
|
// No point in searching for a solution before the chain is
|
||||||
// synced. Also, grab the same lock as used for block
|
// synced. Also, grab the same lock as used for block
|
||||||
// submission, since the current block will be changing and
|
// submission, since the current block will be changing and
|
||||||
|
|
Loading…
Add table
Reference in a new issue