Skip to content

Commit 31e867c

Browse files
committed
fix(cbf): adapt electrum fee source to latest client
- Pass a Duration to electrum-client timeout configuration.\n- Provide the default fee estimation mode for batched estimate_fee calls.\n- Keep integration test imports ordered after the rebase.
1 parent ad2c021 commit 31e867c

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/chain/cbf.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1176,13 +1176,13 @@ impl CbfChainSource {
11761176
tokio::task::spawn_blocking(move || {
11771177
let electrum_config = electrum_client::ConfigBuilder::new()
11781178
.retry(3)
1179-
.timeout(Some(per_request_timeout))
1179+
.timeout(Some(Duration::from_secs(per_request_timeout.into())))
11801180
.build();
11811181
let client = electrum_client::Client::from_config(&server_url, electrum_config)
11821182
.map_err(|_| Error::FeerateEstimationUpdateFailed)?;
11831183
let mut batch = electrum_client::Batch::default();
11841184
for target in confirmation_targets {
1185-
batch.estimate_fee(get_num_block_defaults_for_target(target));
1185+
batch.estimate_fee(get_num_block_defaults_for_target(target), None);
11861186
}
11871187
client.batch_call(&batch).map_err(|_| Error::FeerateEstimationUpdateFailed)
11881188
}),

tests/integration_tests_rust.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use common::{
2424
generate_listening_addresses, open_channel, open_channel_push_amt, open_channel_with_all,
2525
premine_and_distribute_funds, premine_blocks, prepare_rbf, random_chain_source, random_config,
2626
random_listening_addresses, setup_bitcoind_and_electrsd, setup_builder, setup_node,
27-
setup_two_nodes, splice_in_with_all, skip_if_cbf, wait_for_cbf_sync, wait_for_tx,
27+
setup_two_nodes, skip_if_cbf, splice_in_with_all, wait_for_cbf_sync, wait_for_tx,
2828
TestChainSource, TestConfig, TestStoreType, TestSyncStore,
2929
};
3030
use electrsd::corepc_node::Node as BitcoinD;

0 commit comments

Comments
 (0)