mirror of
https://github.com/alexgo-io/stacks-puppet-node.git
synced 2026-04-30 12:42:10 +08:00
fix: if we're not mining, then set the poll time to be 5s (otherwise we waste a *ton* of CPU)
This commit is contained in:
@@ -4171,7 +4171,11 @@ impl PeerThread {
|
|||||||
net.bind(&p2p_sock, &rpc_sock)
|
net.bind(&p2p_sock, &rpc_sock)
|
||||||
.expect("BUG: PeerNetwork could not bind or is already bound");
|
.expect("BUG: PeerNetwork could not bind or is already bound");
|
||||||
|
|
||||||
let poll_timeout = cmp::min(5000, config.miner.first_attempt_time_ms / 2);
|
let poll_timeout = if config.node.miner {
|
||||||
|
cmp::min(5000, config.miner.first_attempt_time_ms / 2)
|
||||||
|
} else {
|
||||||
|
5000
|
||||||
|
};
|
||||||
|
|
||||||
PeerThread {
|
PeerThread {
|
||||||
config,
|
config,
|
||||||
|
|||||||
Reference in New Issue
Block a user