diff options
author | Riccardo Spagni <ric@spagni.net> | 2018-10-02 22:40:51 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2018-10-02 22:40:51 +0200 |
commit | 6cb9c815d46089e2028d592f68e1307d328fd7e8 (patch) | |
tree | d224241c5725f42fb8ceead3e241b91ab304e822 /src/wallet/wallet_rpc_server.cpp | |
parent | Merge pull request #4482 (diff) | |
parent | wallet_rpc_server: include all transfer records for a txid (diff) | |
download | monero-6cb9c815d46089e2028d592f68e1307d328fd7e8.tar.xz |
Merge pull request #4484
2c74b1a1 wallet_rpc_server: include all transfer records for a txid (moneromooo-monero)
Diffstat (limited to 'src/wallet/wallet_rpc_server.cpp')
-rw-r--r-- | src/wallet/wallet_rpc_server.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp index 8b15359cc..2b5ef3157 100644 --- a/src/wallet/wallet_rpc_server.cpp +++ b/src/wallet/wallet_rpc_server.cpp @@ -2173,8 +2173,8 @@ namespace tools for (std::list<std::pair<crypto::hash, tools::wallet2::payment_details>>::const_iterator i = payments.begin(); i != payments.end(); ++i) { if (i->second.m_tx_hash == txid) { - fill_transfer_entry(res.transfer, i->second.m_tx_hash, i->first, i->second); - return true; + res.transfers.resize(res.transfers.size() + 1); + fill_transfer_entry(res.transfers.back(), i->second.m_tx_hash, i->first, i->second); } } @@ -2183,8 +2183,8 @@ namespace tools for (std::list<std::pair<crypto::hash, tools::wallet2::confirmed_transfer_details>>::const_iterator i = payments_out.begin(); i != payments_out.end(); ++i) { if (i->first == txid) { - fill_transfer_entry(res.transfer, i->first, i->second); - return true; + res.transfers.resize(res.transfers.size() + 1); + fill_transfer_entry(res.transfers.back(), i->first, i->second); } } @@ -2193,8 +2193,8 @@ namespace tools for (std::list<std::pair<crypto::hash, tools::wallet2::unconfirmed_transfer_details>>::const_iterator i = upayments.begin(); i != upayments.end(); ++i) { if (i->first == txid) { - fill_transfer_entry(res.transfer, i->first, i->second); - return true; + res.transfers.resize(res.transfers.size() + 1); + fill_transfer_entry(res.transfers.back(), i->first, i->second); } } @@ -2205,11 +2205,17 @@ namespace tools for (std::list<std::pair<crypto::hash, tools::wallet2::pool_payment_details>>::const_iterator i = pool_payments.begin(); i != pool_payments.end(); ++i) { if (i->second.m_pd.m_tx_hash == txid) { - fill_transfer_entry(res.transfer, i->first, i->second); - return true; + res.transfers.resize(res.transfers.size() + 1); + fill_transfer_entry(res.transfers.back(), i->first, i->second); } } + if (!res.transfers.empty()) + { + res.transfer = res.transfers.front(); // backward compat + return true; + } + er.code = WALLET_RPC_ERROR_CODE_WRONG_TXID; er.message = "Transaction not found."; return false; |