mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-20 13:37:28 +02:00
Slightly smarter change key vector padding
This commit is contained in:
parent
79e0cb74ff
commit
2a334b73ec
1 changed files with 5 additions and 2 deletions
|
|
@ -237,8 +237,11 @@ public:
|
||||||
auto pending = MakeUnique<PendingWalletTxImpl>(m_wallet);
|
auto pending = MakeUnique<PendingWalletTxImpl>(m_wallet);
|
||||||
// Pad change keys to cover total possible number of assets
|
// Pad change keys to cover total possible number of assets
|
||||||
// One already exists(for policyAsset), so one for each destination
|
// One already exists(for policyAsset), so one for each destination
|
||||||
for (size_t i = 0; i < recipients.size(); ++i) {
|
std::set<CAsset> assets_seen;
|
||||||
pending->m_keys.emplace_back(new CReserveKey(&m_wallet));
|
for (const auto& rec : recipients) {
|
||||||
|
if (assets_seen.insert(rec.asset).second) {
|
||||||
|
pending->m_keys.emplace_back(new CReserveKey(&m_wallet));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!m_wallet.CreateTransaction(recipients, pending->m_tx, pending->m_keys, fee, change_pos,
|
if (!m_wallet.CreateTransaction(recipients, pending->m_tx, pending->m_keys, fee, change_pos,
|
||||||
fail_reason, coin_control, sign)) {
|
fail_reason, coin_control, sign)) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue