@@ -24,9 +24,7 @@ use core::{cmp::Ordering, fmt, mem, ops::Deref};
2424use bdk_chain:: {
2525 indexed_tx_graph,
2626 indexer:: keychain_txout:: KeychainTxOutIndex ,
27- local_chain:: {
28- self , ApplyHeaderError , CannotConnectError , CheckPoint , CheckPointIter , LocalChain ,
29- } ,
27+ local_chain:: { ApplyHeaderError , CannotConnectError , CheckPoint , CheckPointIter , LocalChain } ,
3028 spk_client:: {
3129 FullScanRequest , FullScanRequestBuilder , FullScanResult , SyncRequest , SyncRequestBuilder ,
3230 SyncResult ,
@@ -120,7 +118,7 @@ pub struct Wallet {
120118
121119/// An update to [`Wallet`].
122120///
123- /// It updates [`KeychainTxOutIndex`], [`bdk_chain::TxGraph`] and [`local_chain:: LocalChain`] atomically.
121+ /// It updates [`KeychainTxOutIndex`], [`bdk_chain::TxGraph`] and [`LocalChain`] atomically.
124122#[ derive( Debug , Clone , Default ) ]
125123pub struct Update {
126124 /// Contains the last active derivation indices per keychain (`K`), which is used to update the
@@ -131,8 +129,6 @@ pub struct Update {
131129 pub tx_update : TxUpdate < ConfirmationBlockTime > ,
132130
133131 /// Update for the wallet's internal [`LocalChain`].
134- ///
135- /// [`LocalChain`]: local_chain::LocalChain
136132 pub chain : Option < CheckPoint > ,
137133}
138134
@@ -1068,44 +1064,6 @@ impl Wallet {
10681064 } )
10691065 }
10701066
1071- /// Add a new checkpoint to the wallet's internal view of the chain.
1072- ///
1073- /// Returns whether anything changed with the insertion (e.g. `false` if checkpoint was already
1074- /// there).
1075- ///
1076- /// **WARNING**: You must persist the changes resulting from one or more calls to this method
1077- /// if you need the inserted checkpoint data to be reloaded after closing the wallet.
1078- /// See [`Wallet::reveal_next_address`].
1079- pub fn insert_checkpoint (
1080- & mut self ,
1081- block_id : BlockId ,
1082- ) -> Result < bool , local_chain:: AlterCheckPointError > {
1083- let changeset = self . chain . insert_block ( block_id) ?;
1084- let changed = !changeset. is_empty ( ) ;
1085- self . stage . merge ( changeset. into ( ) ) ;
1086- Ok ( changed)
1087- }
1088-
1089- /// Add a transaction to the wallet's internal view of the chain. This stages the change,
1090- /// you must persist it later.
1091- ///
1092- /// This method inserts the given `tx` and returns whether anything changed after insertion,
1093- /// which will be false if the same transaction already exists in the wallet's transaction
1094- /// graph. Any changes are staged but not committed.
1095- ///
1096- /// # Note
1097- ///
1098- /// By default the inserted `tx` won't be considered "canonical" because it's not known
1099- /// whether the transaction exists in the best chain. To know whether it exists, the tx
1100- /// must be broadcast to the network and the wallet synced via a chain source.
1101- pub fn insert_tx < T : Into < Arc < Transaction > > > ( & mut self , tx : T ) -> bool {
1102- let mut changeset = ChangeSet :: default ( ) ;
1103- changeset. merge ( self . indexed_graph . insert_tx ( tx) . into ( ) ) ;
1104- let ret = !changeset. is_empty ( ) ;
1105- self . stage . merge ( changeset) ;
1106- ret
1107- }
1108-
11091067 /// Iterate over the transactions in the wallet.
11101068 pub fn transactions ( & self ) -> impl Iterator < Item = WalletTx > + ' _ {
11111069 self . indexed_graph
0 commit comments