Skip to content

Commit fdabb73

Browse files
replace external_sync with batch_sync
1 parent 5dcd370 commit fdabb73

5 files changed

Lines changed: 15 additions & 15 deletions

File tree

config.toml.sample

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ rpc_password = "SomePassword"
77
rpc_host = "https://127.0.0.1:38334"
88

99
[misc]
10-
external_sync = ""
10+
batch_sync = ""

src/blockchain/cli_blockchain/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ use super::{
2929
use crate::try_and_log;
3030

3131
pub struct UtreexodBackend {
32-
pub use_external_sync: bool,
33-
pub external_sync_hostname: String,
32+
pub use_batch_sync: bool,
33+
pub batch_sync_hostname: String,
3434
pub rpc: Arc<BTCDClient>,
3535
pub chainstate: Arc<ChainState<KvChainStore>>,
3636
pub term: Arc<AtomicBool>,
@@ -181,7 +181,7 @@ impl UtreexodBackend {
181181
}
182182
#[allow(unused)]
183183
async fn process_batch_block(&self) -> Result<()> {
184-
let socket = TcpStream::connect(self.external_sync_hostname.to_owned().as_str())?;
184+
let socket = TcpStream::connect(self.batch_sync_hostname.to_owned().as_str())?;
185185

186186
let height = self.get_height()?;
187187
let current = self.chainstate.get_validation_index()?;
@@ -270,7 +270,7 @@ impl UtreexodBackend {
270270
try_and_log!(self.chainstate.flush());
271271
return;
272272
}
273-
if self.use_external_sync {
273+
if self.use_batch_sync {
274274
try_and_log!(self.process_batch_block().await);
275275
} else {
276276
try_and_log!(self.start_ibd().await);

src/cli.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ pub enum Commands {
6464
/// Whether or not we want to sync with a external provider
6565
#[arg(long)]
6666
#[arg(default_value_t = false)]
67-
use_external_sync: bool,
68-
/// If use_external_sync is set, this option provides which server we use
67+
use_batch_sync: bool,
68+
/// If use_batch_sync is set, this option provides which server we use
6969
#[arg(long)]
70-
external_sync: Option<String>,
70+
batch_sync: Option<String>,
7171
/// Assume blocks before this one as having valid signatures, same with bitcoin core
7272
#[arg(long)]
7373
assume_valid: Option<BlockHash>,

src/config_file.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub struct Rpc {
1616
}
1717
#[derive(Default, Debug, Deserialize)]
1818
pub struct Misc {
19-
pub external_sync: Option<String>,
19+
pub batch_sync: Option<String>,
2020
}
2121
#[derive(Default, Debug, Deserialize)]
2222
pub struct ConfigFile {

src/main.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ fn main() {
7474
rpc_user,
7575
rpc_password,
7676
rpc_host,
77-
external_sync,
78-
use_external_sync,
77+
batch_sync,
78+
use_batch_sync,
7979
rpc_port,
8080
wallet_xpub,
8181
assume_valid,
@@ -133,12 +133,12 @@ fn main() {
133133
let chain_provider = UtreexodBackend {
134134
chainstate: blockchain_state.clone(),
135135
rpc,
136-
external_sync_hostname: get_one_or_another(
137-
external_sync,
138-
data.misc.external_sync,
136+
batch_sync_hostname: get_one_or_another(
137+
batch_sync,
138+
data.misc.batch_sync,
139139
"".into(),
140140
),
141-
use_external_sync,
141+
use_batch_sync,
142142
term: shutdown,
143143
};
144144
info!("Starting server");

0 commit comments

Comments
 (0)