diff options
author | Riccardo Spagni <ric@spagni.net> | 2019-01-16 21:30:51 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2019-01-16 21:30:52 +0200 |
commit | f8a10bcc07dafe9183596e26daf6fda5691d3737 (patch) | |
tree | 1805f93bd9fe279a8f9e7bbf595141766817b256 /src/simplewallet | |
parent | Merge pull request #5006 (diff) | |
parent | simplewallet: fix show_transfers colouring, and add red for failed (diff) | |
download | monero-f8a10bcc07dafe9183596e26daf6fda5691d3737.tar.xz |
Merge pull request #5009
5e10dee3 simplewallet: fix show_transfers colouring, and add red for failed (moneromooo-monero)
Diffstat (limited to 'src/simplewallet')
-rw-r--r-- | src/simplewallet/simplewallet.cpp | 6 | ||||
-rw-r--r-- | src/simplewallet/simplewallet.h | 1 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index 4055eb1c6..62f6f0fc5 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -7340,6 +7340,7 @@ bool simple_wallet::get_transfers(std::vector<std::string>& local_args, std::vec const std::string type = pd.m_coinbase ? tr("block") : tr("in"); const bool unlocked = m_wallet->is_transfer_unlocked(pd.m_unlock_time, pd.m_block_height); transfers.push_back({ + type, pd.m_block_height, pd.m_timestamp, type, @@ -7372,6 +7373,7 @@ bool simple_wallet::get_transfers(std::vector<std::string>& local_args, std::vec payment_id = payment_id.substr(0,16); std::string note = m_wallet->get_tx_note(i->first); transfers.push_back({ + "out", pd.m_block_height, pd.m_timestamp, "out", @@ -7409,6 +7411,7 @@ bool simple_wallet::get_transfers(std::vector<std::string>& local_args, std::vec double_spend_note = tr("[Double spend seen on the network: this transaction may or may not end up being mined] "); transfers.push_back({ "pool", + "pool", pd.m_timestamp, "in", false, @@ -7449,6 +7452,7 @@ bool simple_wallet::get_transfers(std::vector<std::string>& local_args, std::vec if ((failed && is_failed) || (!is_failed && pending)) { transfers.push_back({ (is_failed ? "failed" : "pending"), + (is_failed ? "failed" : "pending"), pd.m_timestamp, "out", false, @@ -7496,7 +7500,7 @@ bool simple_wallet::show_transfers(const std::vector<std::string> &args_) for (const auto& transfer : all_transfers) { - const auto color = transfer.confirmed ? ((transfer.direction == "in" || transfer.direction == "block") ? console_color_green : console_color_magenta) : console_color_white; + const auto color = transfer.type == "failed" ? console_color_red : transfer.confirmed ? ((transfer.direction == "in" || transfer.direction == "block") ? console_color_green : console_color_magenta) : console_color_default; std::string destinations = "-"; if (!transfer.outputs.empty()) diff --git a/src/simplewallet/simplewallet.h b/src/simplewallet/simplewallet.h index cc4cf08ea..f364df2ff 100644 --- a/src/simplewallet/simplewallet.h +++ b/src/simplewallet/simplewallet.h @@ -256,6 +256,7 @@ namespace cryptonote struct transfer_view { + std::string type; boost::variant<uint64_t, std::string> block; uint64_t timestamp; std::string direction; |