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:
jude
2024-05-09 12:55:24 -04:00
parent 2ae1c2d43a
commit 1f989fbbe6

View File

@@ -4171,7 +4171,11 @@ impl PeerThread {
net.bind(&p2p_sock, &rpc_sock)
.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 {
config,