commands: fix the capacity of input vectors in create_spend

They were based on the expected size of the outputs vector...
This commit is contained in:
Antoine Poinsot 2022-12-08 17:07:17 +01:00
parent f2312593da
commit 3d5d0134b4
No known key found for this signature in database
GPG Key ID: E13FC145CD3F4304

View File

@ -301,8 +301,8 @@ impl DaemonControl {
// fees, and add necessary information to the PSBT inputs.
let mut in_value = bitcoin::Amount::from_sat(0);
let mut sat_vb = 0;
let mut txins = Vec::with_capacity(destinations.len());
let mut psbt_ins = Vec::with_capacity(destinations.len());
let mut txins = Vec::with_capacity(coins_outpoints.len());
let mut psbt_ins = Vec::with_capacity(coins_outpoints.len());
let mut spent_txs = HashMap::with_capacity(coins_outpoints.len());
let coins = db_conn.coins_by_outpoints(coins_outpoints);
for op in coins_outpoints {