diff --git a/src/bitcoin/mod.rs b/src/bitcoin/mod.rs
index a278d33a..effc0320 100644
--- a/src/bitcoin/mod.rs
+++ b/src/bitcoin/mod.rs
@@ -13,7 +13,7 @@ pub use d::{MempoolEntry, SyncProgress};
use std::{fmt, sync};
-use miniscript::bitcoin::{self, address};
+use miniscript::bitcoin::{self, address, bip32::ChildNumber};
const COINBASE_MATURITY: i32 = 100;
@@ -58,6 +58,17 @@ pub trait BitcoinInterface: Send {
/// Check whether this former tip is part of the current best chain.
fn is_in_chain(&self, tip: &BlockChainTip) -> bool;
+ /// Sync the wallet with the current best chain.
+ /// `receive_index` and `change_index` are the last derivation indices
+ /// that are expected to have been used by the wallet.
+ /// In case there has been a reorg, returns the common ancestor between
+ /// the wallet and the reorged chain.
+ fn sync_wallet(
+ &mut self,
+ receive_index: ChildNumber,
+ change_index: ChildNumber,
+ ) -> Result