mirror of
https://github.com/monero-project/monero.git
synced 2025-08-17 04:10:29 -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
|
@ -5108,10 +5108,15 @@ bool simple_wallet::show_balance_unlocked(bool detailed)
|
|||
success_msg_writer() << tr("Currently selected account: [") << m_current_subaddress_account << tr("] ") << m_wallet->get_subaddress_label({m_current_subaddress_account, 0});
|
||||
const std::string tag = m_wallet->get_account_tags().second[m_current_subaddress_account];
|
||||
success_msg_writer() << tr("Tag: ") << (tag.empty() ? std::string{tr("(No tag assigned)")} : tag);
|
||||
uint64_t blocks_to_unlock;
|
||||
uint64_t unlocked_balance = m_wallet->unlocked_balance(m_current_subaddress_account, &blocks_to_unlock);
|
||||
std::string unlock_time_message;
|
||||
if (blocks_to_unlock > 0)
|
||||
unlock_time_message = (boost::format(" (%lu block(s) to unlock)") % blocks_to_unlock).str();
|
||||
success_msg_writer() << tr("Balance: ") << print_money(m_wallet->balance(m_current_subaddress_account)) << ", "
|
||||
<< tr("unlocked balance: ") << print_money(m_wallet->unlocked_balance(m_current_subaddress_account)) << extra;
|
||||
<< tr("unlocked balance: ") << print_money(unlocked_balance) << unlock_time_message << extra;
|
||||
std::map<uint32_t, uint64_t> balance_per_subaddress = m_wallet->balance_per_subaddress(m_current_subaddress_account);
|
||||
std::map<uint32_t, uint64_t> unlocked_balance_per_subaddress = m_wallet->unlocked_balance_per_subaddress(m_current_subaddress_account);
|
||||
std::map<uint32_t, std::pair<uint64_t, uint64_t>> unlocked_balance_per_subaddress = m_wallet->unlocked_balance_per_subaddress(m_current_subaddress_account);
|
||||
if (!detailed || balance_per_subaddress.empty())
|
||||
return true;
|
||||
success_msg_writer() << tr("Balance per address:");
|
||||
|
@ -5123,7 +5128,7 @@ bool simple_wallet::show_balance_unlocked(bool detailed)
|
|||
cryptonote::subaddress_index subaddr_index = {m_current_subaddress_account, i.first};
|
||||
std::string address_str = m_wallet->get_subaddress_as_str(subaddr_index).substr(0, 6);
|
||||
uint64_t num_unspent_outputs = std::count_if(transfers.begin(), transfers.end(), [&subaddr_index](const tools::wallet2::transfer_details& td) { return !td.m_spent && td.m_subaddr_index == subaddr_index; });
|
||||
success_msg_writer() << boost::format(tr("%8u %6s %21s %21s %7u %21s")) % i.first % address_str % print_money(i.second) % print_money(unlocked_balance_per_subaddress[i.first]) % num_unspent_outputs % m_wallet->get_subaddress_label(subaddr_index);
|
||||
success_msg_writer() << boost::format(tr("%8u %6s %21s %21s %7u %21s")) % i.first % address_str % print_money(i.second) % print_money(unlocked_balance_per_subaddress[i.first].first) % num_unspent_outputs % m_wallet->get_subaddress_label(subaddr_index);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue