mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-10 09:06:15 +01:00
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:
parent
f0745d028e
commit
c76aaaf900
1 changed files with 1 additions and 0 deletions
|
@ -1154,6 +1154,7 @@ static util::Result<CreatedTransactionResult> CreateTransactionInternal(
|
||||||
result.GetSelectedValue());
|
result.GetSelectedValue());
|
||||||
|
|
||||||
// vouts to the payees
|
// vouts to the payees
|
||||||
|
txNew.vout.reserve(vecSend.size() + 1); // + 1 because of possible later insert
|
||||||
for (const auto& recipient : vecSend)
|
for (const auto& recipient : vecSend)
|
||||||
{
|
{
|
||||||
txNew.vout.emplace_back(recipient.nAmount, GetScriptForDestination(recipient.dest));
|
txNew.vout.emplace_back(recipient.nAmount, GetScriptForDestination(recipient.dest));
|
||||||
|
|
Loading…
Add table
Reference in a new issue