diff options
Diffstat (limited to 'src/simplewallet')
-rw-r--r-- | src/simplewallet/simplewallet.cpp | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index 10dc9d509..eb763b0cd 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -3083,6 +3083,7 @@ bool simple_wallet::show_transfers(const std::vector<std::string> &args_) bool out = true; bool pending = true; bool failed = true; + bool pool = true; uint64_t min_height = 0; uint64_t max_height = (uint64_t)-1; @@ -3100,7 +3101,7 @@ bool simple_wallet::show_transfers(const std::vector<std::string> &args_) local_args.erase(local_args.begin()); } else if (local_args[0] == "out" || local_args[0] == "outgoing") { - in = false; + in = pool = false; local_args.erase(local_args.begin()); } else if (local_args[0] == "pending") { @@ -3108,7 +3109,11 @@ bool simple_wallet::show_transfers(const std::vector<std::string> &args_) local_args.erase(local_args.begin()); } else if (local_args[0] == "failed") { - in = out = pending = false; + in = out = pending = pool = false; + local_args.erase(local_args.begin()); + } + else if (local_args[0] == "pool") { + in = out = pending = failed = false; local_args.erase(local_args.begin()); } else if (local_args[0] == "all" || local_args[0] == "both") { @@ -3183,6 +3188,27 @@ bool simple_wallet::show_transfers(const std::vector<std::string> &args_) ((unsigned long long)i->first) % (i->second.first ? tr("in") : tr("out")) % i->second.second; } + if (pool) { + try + { + m_wallet->update_pool_state(); + std::list<std::pair<crypto::hash, tools::wallet2::payment_details>> payments; + m_wallet->get_unconfirmed_payments(payments); + for (std::list<std::pair<crypto::hash, tools::wallet2::payment_details>>::const_iterator i = payments.begin(); i != payments.end(); ++i) { + const tools::wallet2::payment_details &pd = i->second; + std::string payment_id = string_tools::pod_to_hex(i->first); + if (payment_id.substr(16).find_first_not_of('0') == std::string::npos) + payment_id = payment_id.substr(0,16); + std::string note = m_wallet->get_tx_note(pd.m_tx_hash); + message_writer() << (boost::format("%8.8s %6.6s %16.16s %20.20s %s %s %s %s") % "pool" % "in" % get_human_readable_timestamp(pd.m_timestamp) % print_money(pd.m_amount) % string_tools::pod_to_hex(pd.m_tx_hash) % payment_id % "-" % note).str(); + } + } + catch (...) + { + fail_msg_writer() << "Failed to get pool state"; + } + } + // print unconfirmed last if (pending || failed) { std::list<std::pair<crypto::hash, tools::wallet2::unconfirmed_transfer_details>> upayments; @@ -3238,6 +3264,8 @@ bool simple_wallet::run() // check and display warning, but go on anyway try_connect_to_daemon(); + refresh_main(0, false); + std::string addr_start = m_wallet->get_account().get_public_address_str(m_wallet->testnet()).substr(0, 6); m_auto_refresh_run = m_wallet->auto_refresh(); if (m_auto_refresh_run) |