diff options
author | Alexander Blair <snipa@jagtech.io> | 2020-02-28 19:49:41 -0800 |
---|---|---|
committer | Alexander Blair <snipa@jagtech.io> | 2020-02-28 19:49:41 -0800 |
commit | 5bd496e8ef6eee9f885e02feaf63e74f04217c5a (patch) | |
tree | 225ebcd6296cd43366df88f1952fe26c8a4c700d /src/wallet/wallet_rpc_server.cpp | |
parent | Merge pull request #6236 (diff) | |
parent | wallet-cli/rpc: allow sweep_all to use outputs in all subaddresses within an ... (diff) | |
download | monero-5bd496e8ef6eee9f885e02feaf63e74f04217c5a.tar.xz |
Merge pull request #6241
ae84ec90 wallet-cli/rpc: allow sweep_all to use outputs in all subaddresses within an account (stoffu)
Diffstat (limited to 'src/wallet/wallet_rpc_server.cpp')
-rw-r--r-- | src/wallet/wallet_rpc_server.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp index 338ee4866..42973f3eb 100644 --- a/src/wallet/wallet_rpc_server.cpp +++ b/src/wallet/wallet_rpc_server.cpp @@ -1416,11 +1416,22 @@ namespace tools return false; } + std::set<uint32_t> subaddr_indices; + if (req.subaddr_indices_all) + { + for (uint32_t i = 0; i < m_wallet->get_num_subaddresses(req.account_index); ++i) + subaddr_indices.insert(i); + } + else + { + subaddr_indices= req.subaddr_indices; + } + try { uint64_t mixin = m_wallet->adjust_mixin(req.ring_size ? req.ring_size - 1 : 0); uint32_t priority = m_wallet->adjust_priority(req.priority); - std::vector<wallet2::pending_tx> ptx_vector = m_wallet->create_transactions_all(req.below_amount, dsts[0].addr, dsts[0].is_subaddress, req.outputs, mixin, req.unlock_time, priority, extra, req.account_index, req.subaddr_indices); + std::vector<wallet2::pending_tx> ptx_vector = m_wallet->create_transactions_all(req.below_amount, dsts[0].addr, dsts[0].is_subaddress, req.outputs, mixin, req.unlock_time, priority, extra, req.account_index, subaddr_indices); return fill_response(ptx_vector, req.get_tx_keys, res.tx_key_list, res.amount_list, res.fee_list, res.weight_list, res.multisig_txset, res.unsigned_txset, req.do_not_relay, res.tx_hash_list, req.get_tx_hex, res.tx_blob_list, req.get_tx_metadata, res.tx_metadata_list, er); |