Skip to content

Commit 70458f6

Browse files
committed
Pad change keys for wallet interface pending txs
1 parent 466b3d0 commit 70458f6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/interfaces/wallet.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,11 @@ class WalletImpl : public Wallet
235235
{
236236
LOCK2(cs_main, m_wallet.cs_wallet);
237237
auto pending = MakeUnique<PendingWalletTxImpl>(m_wallet);
238+
// Pad change keys to cover total possible number of assets
239+
// One already exists(for policyAsset), so one for each destination
240+
for (size_t i = 0; i < recipients.size(); ++i) {
241+
pending->m_keys.emplace_back(new CReserveKey(&m_wallet));
242+
}
238243
if (!m_wallet.CreateTransaction(recipients, pending->m_tx, pending->m_keys, fee, change_pos,
239244
fail_reason, coin_control, sign)) {
240245
return {};

0 commit comments

Comments
 (0)