Skip to content

Commit c76aaaf

Browse files
l0rinctheuni
andcommitted
Reserve space for transaction outputs in CreateTransactionInternal
Accommodating possible later insert as well Co-authored-by: Cory Fields <[email protected]>
1 parent f0745d0 commit c76aaaf

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/wallet/spend.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,6 +1154,7 @@ static util::Result<CreatedTransactionResult> CreateTransactionInternal(
11541154
result.GetSelectedValue());
11551155

11561156
// vouts to the payees
1157+
txNew.vout.reserve(vecSend.size() + 1); // + 1 because of possible later insert
11571158
for (const auto& recipient : vecSend)
11581159
{
11591160
txNew.vout.emplace_back(recipient.nAmount, GetScriptForDestination(recipient.dest));

0 commit comments

Comments
 (0)