Merge pull request #6241
ae84ec90 wallet-cli/rpc: allow sweep_all to use outputs in all subaddresses within an account (stoffu)
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -761,6 +761,7 @@ namespace wallet_rpc
|
||||
std::string address;
|
||||
uint32_t account_index;
|
||||
std::set<uint32_t> subaddr_indices;
|
||||
bool subaddr_indices_all;
|
||||
uint32_t priority;
|
||||
uint64_t ring_size;
|
||||
uint64_t outputs;
|
||||
@@ -776,6 +777,7 @@ namespace wallet_rpc
|
||||
KV_SERIALIZE(address)
|
||||
KV_SERIALIZE(account_index)
|
||||
KV_SERIALIZE(subaddr_indices)
|
||||
KV_SERIALIZE_OPT(subaddr_indices_all, false)
|
||||
KV_SERIALIZE(priority)
|
||||
KV_SERIALIZE_OPT(ring_size, (uint64_t)0)
|
||||
KV_SERIALIZE_OPT(outputs, (uint64_t)1)
|
||||
|
||||
Reference in New Issue
Block a user