diff options
author | binaryFate <binaryfate@users.noreply.github.com> | 2017-06-25 20:42:56 +0200 |
---|---|---|
committer | binaryFate <binaryfate@users.noreply.github.com> | 2017-06-26 12:22:12 +0200 |
commit | 5a09d79caf699c3dc33e889e1db412f41e7b0414 (patch) | |
tree | f203aee902f9e660e08e02334f962d1eb2fcc514 /src/wallet/wallet_rpc_server.cpp | |
parent | Merge pull request #2111 (diff) | |
download | monero-5a09d79caf699c3dc33e889e1db412f41e7b0414.tar.xz |
Fix #2120: return per-tx amount in transfer_split RPC call.
Diffstat (limited to 'src/wallet/wallet_rpc_server.cpp')
-rw-r--r-- | src/wallet/wallet_rpc_server.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp index f2b3dcaf5..afedc61a6 100644 --- a/src/wallet/wallet_rpc_server.cpp +++ b/src/wallet/wallet_rpc_server.cpp @@ -509,6 +509,7 @@ namespace tools try { uint64_t mixin = req.mixin; + uint64_t ptx_amount; if (mixin < 2 && m_wallet->use_fork_rules(2, 10)) { LOG_PRINT_L1("Requested mixin " << req.mixin << " too low for hard fork 2, using 2"); mixin = 2; @@ -530,6 +531,12 @@ namespace tools { res.tx_key_list.push_back(epee::string_tools::pod_to_hex(ptx.tx_key)); } + // Compute amount leaving wallet in tx. By convention dests does not include change outputs + ptx_amount = 0; + for(auto & dt: ptx.dests) + ptx_amount += dt.amount; + res.amount_list.push_back(ptx_amount); + res.fee_list.push_back(ptx.fee); } |