File tree Expand file tree Collapse file tree 2 files changed +4
-16
lines changed Expand file tree Collapse file tree 2 files changed +4
-16
lines changed Original file line number Diff line number Diff line change @@ -94,13 +94,6 @@ pub enum CreateTxError {
94
94
ChangePolicyDescriptor ,
95
95
/// There was an error with coin selection
96
96
CoinSelection ( coin_selection:: Error ) ,
97
- /// Wallet's UTXO set is not enough to cover recipient's requested plus fee
98
- InsufficientFunds {
99
- /// Sats needed for some transaction
100
- needed : u64 ,
101
- /// Sats available for spending
102
- available : u64 ,
103
- } ,
104
97
/// Cannot build a tx without recipients
105
98
NoRecipients ,
106
99
/// Partially signed bitcoin transaction error
@@ -184,13 +177,6 @@ impl fmt::Display for CreateTxError {
184
177
)
185
178
}
186
179
CreateTxError :: CoinSelection ( e) => e. fmt ( f) ,
187
- CreateTxError :: InsufficientFunds { needed, available } => {
188
- write ! (
189
- f,
190
- "Insufficient funds: {} sat available of {} sat needed" ,
191
- available, needed
192
- )
193
- }
194
180
CreateTxError :: NoRecipients => {
195
181
write ! ( f, "Cannot build tx without recipients" )
196
182
}
Original file line number Diff line number Diff line change @@ -73,6 +73,8 @@ use crate::types::*;
73
73
use crate :: wallet:: coin_selection:: Excess :: { Change , NoChange } ;
74
74
use crate :: wallet:: error:: { BuildFeeBumpError , CreateTxError , MiniscriptPsbtError } ;
75
75
76
+ use self :: coin_selection:: Error ;
77
+
76
78
const COINBASE_MATURITY : u32 = 100 ;
77
79
78
80
/// A Bitcoin wallet
@@ -1595,10 +1597,10 @@ impl Wallet {
1595
1597
change_fee,
1596
1598
} = excess
1597
1599
{
1598
- return Err ( CreateTxError :: InsufficientFunds {
1600
+ return Err ( CreateTxError :: CoinSelection ( Error :: InsufficientFunds {
1599
1601
needed : * dust_threshold,
1600
1602
available : remaining_amount. saturating_sub ( * change_fee) ,
1601
- } ) ;
1603
+ } ) ) ;
1602
1604
}
1603
1605
} else {
1604
1606
return Err ( CreateTxError :: NoRecipients ) ;
You can’t perform that action at this time.
0 commit comments