From e6021f5bee2c620d351014519e92efaaf3b64d2f Mon Sep 17 00:00:00 2001 From: Jude Nelson Date: Tue, 14 May 2024 14:19:19 -0400 Subject: [PATCH] chore: fix compile issues in stacks-node --- stackslib/src/net/api/getstxtransfercost.rs | 2 +- testnet/stacks-node/src/config.rs | 6 +++--- testnet/stacks-node/src/neon_node.rs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/stackslib/src/net/api/getstxtransfercost.rs b/stackslib/src/net/api/getstxtransfercost.rs index 22e4b4826..b8801e7d7 100644 --- a/stackslib/src/net/api/getstxtransfercost.rs +++ b/stackslib/src/net/api/getstxtransfercost.rs @@ -170,7 +170,7 @@ impl HttpResponse for RPCGetStxTransferCostRequestHandler { impl StacksHttpRequest { pub fn new_get_stx_transfer_cost(host: PeerHost) -> StacksHttpRequest { - let mut contents = HttpRequestContents::new(); + let contents = HttpRequestContents::new(); StacksHttpRequest::new_for_peer(host, "GET".into(), "/v2/fees/transfer".into(), contents) .expect("FATAL: failed to construct request from infallible data") } diff --git a/testnet/stacks-node/src/config.rs b/testnet/stacks-node/src/config.rs index 2d3288d5f..65eea9134 100644 --- a/testnet/stacks-node/src/config.rs +++ b/testnet/stacks-node/src/config.rs @@ -4,7 +4,7 @@ use std::path::PathBuf; use std::str::FromStr; use std::sync::{Arc, Mutex}; use std::time::Duration; -use std::{fs, thread}; +use std::{cmp, fs, thread}; use clarity::vm::costs::ExecutionCost; use clarity::vm::types::{AssetIdentifier, PrincipalData, QualifiedContractIdentifier}; @@ -1329,8 +1329,8 @@ impl Config { /// part dependent on the state machine getting block data back to the miner quickly, and thus /// the poll time is dependent on the first attempt time. pub fn get_poll_time(&self) -> u64 { - let poll_timeout = if config.node.miner { - cmp::min(5000, config.miner.first_attempt_time_ms / 2) + let poll_timeout = if self.node.miner { + cmp::min(5000, self.miner.first_attempt_time_ms / 2) } else { 5000 }; diff --git a/testnet/stacks-node/src/neon_node.rs b/testnet/stacks-node/src/neon_node.rs index b6be08e3f..c4eff65ff 100644 --- a/testnet/stacks-node/src/neon_node.rs +++ b/testnet/stacks-node/src/neon_node.rs @@ -4171,7 +4171,7 @@ impl PeerThread { net.bind(&p2p_sock, &rpc_sock) .expect("BUG: PeerNetwork could not bind or is already bound"); - let poll_timeout = config.get_poll_timeout(); + let poll_timeout = config.get_poll_time(); PeerThread { config,