diff options
author | Riccardo Spagni <ric@spagni.net> | 2016-04-02 12:02:07 +0900 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2016-04-02 12:02:07 +0900 |
commit | a38ad63f8f0c9941ea964519f8e9d25db5e594b2 (patch) | |
tree | fb6f5bf87c8c55dfd017bd567a4ddb19db59a033 /src/wallet/wallet_errors.h | |
parent | Merge pull request #766 (diff) | |
parent | Convey tx verification failure reasons to the RPC client (diff) | |
download | monero-a38ad63f8f0c9941ea964519f8e9d25db5e594b2.tar.xz |
Merge pull request #767
24b3e90 Convey tx verification failure reasons to the RPC client (moneromooo-monero)
Diffstat (limited to 'src/wallet/wallet_errors.h')
-rw-r--r-- | src/wallet/wallet_errors.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/wallet/wallet_errors.h b/src/wallet/wallet_errors.h index 652b19499..3de97f49d 100644 --- a/src/wallet/wallet_errors.h +++ b/src/wallet/wallet_errors.h @@ -458,15 +458,17 @@ namespace tools //---------------------------------------------------------------------------------------------------- struct tx_rejected : public transfer_error { - explicit tx_rejected(std::string&& loc, const cryptonote::transaction& tx, const std::string& status) + explicit tx_rejected(std::string&& loc, const cryptonote::transaction& tx, const std::string& status, const std::string& reason) : transfer_error(std::move(loc), "transaction was rejected by daemon") , m_tx(tx) , m_status(status) + , m_reason(reason) { } const cryptonote::transaction& tx() const { return m_tx; } const std::string& status() const { return m_status; } + const std::string& reason() const { return m_reason; } std::string to_string() const { @@ -474,12 +476,17 @@ namespace tools ss << transfer_error::to_string() << ", status = " << m_status << ", tx:\n"; cryptonote::transaction tx = m_tx; ss << cryptonote::obj_to_json_str(tx); + if (!m_reason.empty()) + { + ss << " (" << m_reason << ")"; + } return ss.str(); } private: cryptonote::transaction m_tx; std::string m_status; + std::string m_reason; }; //---------------------------------------------------------------------------------------------------- struct tx_sum_overflow : public transfer_error |