mirror of
https://github.com/monero-project/monero.git
synced 2025-10-16 12:20:42 -04:00
Merge pull request #5382
c12b43cb
wallet: add number of blocks required for the balance to fully unlock (moneromooo-monero)3f1e9e84
wallet2: set confirmations to 0 for pool txes in proofs (moneromooo-monero)36c037ec
wallet_rpc_server: error out on getting the spend key from a hot wallet (moneromooo-monero)cd1eaff2
wallet_rpc_server: always fill out subaddr_indices in get_transfers (moneromooo-monero)
This commit is contained in:
commit
5c02316598
5 changed files with 63 additions and 22 deletions
|
@ -447,10 +447,10 @@ namespace tools
|
|||
try
|
||||
{
|
||||
res.balance = req.all_accounts ? m_wallet->balance_all() : m_wallet->balance(req.account_index);
|
||||
res.unlocked_balance = req.all_accounts ? m_wallet->unlocked_balance_all() : m_wallet->unlocked_balance(req.account_index);
|
||||
res.unlocked_balance = req.all_accounts ? m_wallet->unlocked_balance_all(&res.blocks_to_unlock) : m_wallet->unlocked_balance(req.account_index, &res.blocks_to_unlock);
|
||||
res.multisig_import_needed = m_wallet->multisig() && m_wallet->has_multisig_partial_key_images();
|
||||
std::map<uint32_t, std::map<uint32_t, uint64_t>> balance_per_subaddress_per_account;
|
||||
std::map<uint32_t, std::map<uint32_t, uint64_t>> unlocked_balance_per_subaddress_per_account;
|
||||
std::map<uint32_t, std::map<uint32_t, std::pair<uint64_t, uint64_t>>> unlocked_balance_per_subaddress_per_account;
|
||||
if (req.all_accounts)
|
||||
{
|
||||
for (uint32_t account_index = 0; account_index < m_wallet->get_num_subaddress_accounts(); ++account_index)
|
||||
|
@ -470,7 +470,7 @@ namespace tools
|
|||
{
|
||||
uint32_t account_index = p.first;
|
||||
std::map<uint32_t, uint64_t> balance_per_subaddress = p.second;
|
||||
std::map<uint32_t, uint64_t> unlocked_balance_per_subaddress = unlocked_balance_per_subaddress_per_account[account_index];
|
||||
std::map<uint32_t, std::pair<uint64_t, uint64_t>> unlocked_balance_per_subaddress = unlocked_balance_per_subaddress_per_account[account_index];
|
||||
std::set<uint32_t> address_indices;
|
||||
if (!req.all_accounts && !req.address_indices.empty())
|
||||
{
|
||||
|
@ -489,7 +489,8 @@ namespace tools
|
|||
cryptonote::subaddress_index index = {info.account_index, info.address_index};
|
||||
info.address = m_wallet->get_subaddress_as_str(index);
|
||||
info.balance = balance_per_subaddress[i];
|
||||
info.unlocked_balance = unlocked_balance_per_subaddress[i];
|
||||
info.unlocked_balance = unlocked_balance_per_subaddress[i].first;
|
||||
info.blocks_to_unlock = unlocked_balance_per_subaddress[i].second;
|
||||
info.label = m_wallet->get_subaddress_label(index);
|
||||
info.num_unspent_outputs = std::count_if(transfers.begin(), transfers.end(), [&](const tools::wallet2::transfer_details& td) { return !td.m_spent && td.m_subaddr_index == index; });
|
||||
res.per_subaddress.emplace_back(std::move(info));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue