From 3d5d0134b4b5bc06910a89d23def36de5b548c30 Mon Sep 17 00:00:00 2001 From: Antoine Poinsot Date: Thu, 8 Dec 2022 17:07:17 +0100 Subject: [PATCH] commands: fix the capacity of input vectors in create_spend They were based on the expected size of the outputs vector... --- src/commands/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commands/mod.rs b/src/commands/mod.rs index 05183ea0..52f45c02 100644 --- a/src/commands/mod.rs +++ b/src/commands/mod.rs @@ -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 {