@@ -6,9 +6,9 @@ use crate::error::{
6
6
} ;
7
7
use crate :: store:: { PersistenceType , Persister } ;
8
8
use crate :: types:: {
9
- AddressInfo , Balance , BlockId , CanonicalTx , FullScanRequestBuilder , KeychainAndIndex ,
10
- LocalOutput , Policy , SentAndReceivedValues , SignOptions , SyncRequestBuilder , UnconfirmedTx ,
11
- Update ,
9
+ AddressInfo , Balance , BlockId , CanonicalTx , EvictedTx , FullScanRequestBuilder ,
10
+ KeychainAndIndex , LocalOutput , Policy , SentAndReceivedValues , SignOptions , SyncRequestBuilder ,
11
+ UnconfirmedTx , Update ,
12
12
} ;
13
13
14
14
use bdk_wallet:: bitcoin:: Network ;
@@ -223,6 +223,19 @@ impl Wallet {
223
223
)
224
224
}
225
225
226
+ /// Apply transactions that have been evicted from the mempool.
227
+ /// Transactions may be evicted for paying too-low fee, or for being malformed.
228
+ /// Irrelevant transactions are ignored.
229
+ ///
230
+ /// For more information: https://docs.rs/bdk_wallet/latest/bdk_wallet/struct.Wallet.html#method.apply_evicted_txs
231
+ pub fn apply_evicted_txs ( & self , evicted_txs : Vec < EvictedTx > ) {
232
+ self . get_wallet ( ) . apply_evicted_txs (
233
+ evicted_txs
234
+ . into_iter ( )
235
+ . map ( |etx| ( etx. txid . 0 , etx. evicted_at ) ) ,
236
+ ) ;
237
+ }
238
+
226
239
/// The derivation index of this wallet. It will return `None` if it has not derived any addresses.
227
240
/// Otherwise, it will return the index of the highest address it has derived.
228
241
pub fn derivation_index ( & self , keychain : KeychainKind ) -> Option < u32 > {
0 commit comments