Reserve space for transaction outputs in CreateTransactionInternal

Accommodating possible later insert as well

Co-authored-by: Cory Fields <cory-nospam-@coryfields.com>
This commit is contained in:
Lőrinc 2024-05-13 22:03:27 +02:00
parent f0745d028e
commit c76aaaf900

View file

@ -1154,6 +1154,7 @@ static util::Result<CreatedTransactionResult> CreateTransactionInternal(
result.GetSelectedValue());
// vouts to the payees
txNew.vout.reserve(vecSend.size() + 1); // + 1 because of possible later insert
for (const auto& recipient : vecSend)
{
txNew.vout.emplace_back(recipient.nAmount, GetScriptForDestination(recipient.dest));