diff options
author | Riccardo Spagni <ric@spagni.net> | 2018-01-25 16:32:40 -0800 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2018-01-25 16:32:40 -0800 |
commit | f077bbb4f177bdd4244322e2486eb8d610b57b02 (patch) | |
tree | 73c764471b64fac9f4cd34f2544fe534e3ae30cb /src | |
parent | Merge pull request #3009 (diff) | |
parent | Resolve addresses in get_transfers (diff) | |
download | monero-f077bbb4f177bdd4244322e2486eb8d610b57b02.tar.xz |
Merge pull request #3010
07da9c80 Resolve addresses in get_transfers (Michał Sałaban)
Diffstat (limited to 'src')
-rw-r--r-- | src/wallet/wallet_rpc_server.cpp | 4 | ||||
-rw-r--r-- | src/wallet/wallet_rpc_server_commands_defs.h | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp index fc2c43c04..e53fd6fce 100644 --- a/src/wallet/wallet_rpc_server.cpp +++ b/src/wallet/wallet_rpc_server.cpp @@ -258,6 +258,7 @@ namespace tools entry.note = m_wallet->get_tx_note(pd.m_tx_hash); entry.type = "in"; entry.subaddr_index = pd.m_subaddr_index; + entry.address = m_wallet->get_subaddress_as_str(pd.m_subaddr_index); } //------------------------------------------------------------------------------------------------------------------------------ void wallet_rpc_server::fill_transfer_entry(tools::wallet_rpc::transfer_entry &entry, const crypto::hash &txid, const tools::wallet2::confirmed_transfer_details &pd) @@ -283,6 +284,7 @@ namespace tools entry.type = "out"; entry.subaddr_index = { pd.m_subaddr_account, 0 }; + entry.address = m_wallet->get_subaddress_as_str({pd.m_subaddr_account, 0}); } //------------------------------------------------------------------------------------------------------------------------------ void wallet_rpc_server::fill_transfer_entry(tools::wallet_rpc::transfer_entry &entry, const crypto::hash &txid, const tools::wallet2::unconfirmed_transfer_details &pd) @@ -301,6 +303,7 @@ namespace tools entry.note = m_wallet->get_tx_note(txid); entry.type = is_failed ? "failed" : "pending"; entry.subaddr_index = { pd.m_subaddr_account, 0 }; + entry.address = m_wallet->get_subaddress_as_str({pd.m_subaddr_account, 0}); } //------------------------------------------------------------------------------------------------------------------------------ void wallet_rpc_server::fill_transfer_entry(tools::wallet_rpc::transfer_entry &entry, const crypto::hash &payment_id, const tools::wallet2::pool_payment_details &ppd) @@ -319,6 +322,7 @@ namespace tools entry.double_spend_seen = ppd.m_double_spend_seen; entry.type = "pool"; entry.subaddr_index = pd.m_subaddr_index; + entry.address = m_wallet->get_subaddress_as_str(pd.m_subaddr_index); } //------------------------------------------------------------------------------------------------------------------------------ bool wallet_rpc_server::on_getbalance(const wallet_rpc::COMMAND_RPC_GET_BALANCE::request& req, wallet_rpc::COMMAND_RPC_GET_BALANCE::response& res, epee::json_rpc::error& er) diff --git a/src/wallet/wallet_rpc_server_commands_defs.h b/src/wallet/wallet_rpc_server_commands_defs.h index d797af5c1..4abbb8386 100644 --- a/src/wallet/wallet_rpc_server_commands_defs.h +++ b/src/wallet/wallet_rpc_server_commands_defs.h @@ -1114,6 +1114,7 @@ namespace wallet_rpc std::string type; uint64_t unlock_time; cryptonote::subaddress_index subaddr_index; + std::string address; bool double_spend_seen; BEGIN_KV_SERIALIZE_MAP() @@ -1128,6 +1129,7 @@ namespace wallet_rpc KV_SERIALIZE(type); KV_SERIALIZE(unlock_time) KV_SERIALIZE(subaddr_index); + KV_SERIALIZE(address); KV_SERIALIZE(double_spend_seen) END_KV_SERIALIZE_MAP() }; |