Wait for conection to peer before mining with CPU.

This commit is contained in:
Dave Collins 2014-06-19 09:44:12 -05:00
parent 6dc257b8c8
commit 5f444ce000

View file

@ -270,6 +270,14 @@ out:
// 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
// synced. Also, grab the same lock as used for block
// submission, since the current block will be changing and