From 70458f6f9d8999317e3cffab4ef6df6abbbded71 Mon Sep 17 00:00:00 2001 From: Gregory Sanders Date: Tue, 9 Apr 2019 12:12:13 -0400 Subject: [PATCH] Pad change keys for wallet interface pending txs --- src/interfaces/wallet.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/interfaces/wallet.cpp b/src/interfaces/wallet.cpp index 33185c297d..312ca27803 100644 --- a/src/interfaces/wallet.cpp +++ b/src/interfaces/wallet.cpp @@ -235,6 +235,11 @@ public: { LOCK2(cs_main, m_wallet.cs_wallet); auto pending = MakeUnique(m_wallet); + // Pad change keys to cover total possible number of assets + // One already exists(for policyAsset), so one for each destination + for (size_t i = 0; i < recipients.size(); ++i) { + pending->m_keys.emplace_back(new CReserveKey(&m_wallet)); + } if (!m_wallet.CreateTransaction(recipients, pending->m_tx, pending->m_keys, fee, change_pos, fail_reason, coin_control, sign)) { return {};