mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-18 22:35:39 +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:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user