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 @@ -92,13 +92,6 @@ pub enum CreateTxError {
92
92
OutputBelowDustLimit ( usize ) ,
93
93
/// There was an error with coin selection
94
94
CoinSelection ( coin_selection:: Error ) ,
95
- /// Wallet's UTXO set is not enough to cover recipient's requested plus fee
96
- InsufficientFunds {
97
- /// Sats needed for some transaction
98
- needed : u64 ,
99
- /// Sats available for spending
100
- available : u64 ,
101
- } ,
102
95
/// Cannot build a tx without recipients
103
96
NoRecipients ,
104
97
/// Partially signed bitcoin transaction error
@@ -176,13 +169,6 @@ impl fmt::Display for CreateTxError {
176
169
write ! ( f, "Output below the dust limit: {}" , limit)
177
170
}
178
171
CreateTxError :: CoinSelection ( e) => e. fmt ( f) ,
179
- CreateTxError :: InsufficientFunds { needed, available } => {
180
- write ! (
181
- f,
182
- "Insufficient funds: {} sat available of {} sat needed" ,
183
- available, needed
184
- )
185
- }
186
172
CreateTxError :: NoRecipients => {
187
173
write ! ( f, "Cannot build tx without recipients" )
188
174
}
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
@@ -1562,10 +1564,10 @@ impl Wallet {
1562
1564
change_fee,
1563
1565
} = excess
1564
1566
{
1565
- return Err ( CreateTxError :: InsufficientFunds {
1567
+ return Err ( CreateTxError :: CoinSelection ( Error :: InsufficientFunds {
1566
1568
needed : * dust_threshold,
1567
1569
available : remaining_amount. saturating_sub ( * change_fee) ,
1568
- } ) ;
1570
+ } ) ) ;
1569
1571
}
1570
1572
} else {
1571
1573
return Err ( CreateTxError :: NoRecipients ) ;
You can’t perform that action at this time.
0 commit comments