File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -2093,11 +2093,11 @@ impl Wallet {
2093
2093
. 0
2094
2094
}
2095
2095
2096
- /// Informs the wallet that you no longer intend to broadcast a tx that was built from it .
2096
+ /// Unreserves the change address used in a transaction that will not be broadcast .
2097
2097
///
2098
2098
/// This frees up the change address used when creating the tx for use in future transactions.
2099
2099
// TODO: Make this free up reserved utxos when that's implemented
2100
- pub fn cancel_tx ( & mut self , tx : & Transaction ) {
2100
+ pub fn unreserve_change_address ( & mut self , tx : & Transaction ) {
2101
2101
let txout_index = & mut self . indexed_graph . index ;
2102
2102
for txout in & tx. output {
2103
2103
if let Some ( ( keychain, index) ) = txout_index. index_of_spk ( txout. script_pubkey . clone ( ) ) {
Original file line number Diff line number Diff line change @@ -2801,7 +2801,7 @@ fn test_tx_cancellation() {
2801
2801
. unwrap ( ) ;
2802
2802
assert_eq ! ( change_derivation_2, ( KeychainKind :: Internal , 1 ) ) ;
2803
2803
2804
- wallet. cancel_tx ( & psbt1. extract_tx ( ) . expect ( "failed to extract tx" ) ) ;
2804
+ wallet. unreserve_change_address ( & psbt1. extract_tx ( ) . expect ( "failed to extract tx" ) ) ;
2805
2805
2806
2806
let psbt3 = new_tx ! ( wallet) ;
2807
2807
let change_derivation_3 = psbt3
@@ -2821,7 +2821,7 @@ fn test_tx_cancellation() {
2821
2821
. unwrap ( ) ;
2822
2822
assert_eq ! ( change_derivation_3, ( KeychainKind :: Internal , 2 ) ) ;
2823
2823
2824
- wallet. cancel_tx ( & psbt3. extract_tx ( ) . expect ( "failed to extract tx" ) ) ;
2824
+ wallet. unreserve_change_address ( & psbt3. extract_tx ( ) . expect ( "failed to extract tx" ) ) ;
2825
2825
2826
2826
let psbt3 = new_tx ! ( wallet) ;
2827
2827
let change_derivation_4 = psbt3
You can’t perform that action at this time.
0 commit comments