aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-07-03 12:28:56 +0200
committerRiccardo Spagni <ric@spagni.net>2017-07-03 12:28:56 +0200
commit645c898e2dc9f1c82bd9e7f4c2029a77566827b6 (patch)
treed54751defed4058956f87983d4415563bf2eb2f9 /src
parentMerge pull request #2116 (diff)
parentFix #2120: return per-tx amount in transfer_split RPC call. (diff)
downloadmonero-645c898e2dc9f1c82bd9e7f4c2029a77566827b6.tar.xz
Merge pull request #2121
5a09d79c Fix #2120: return per-tx amount in transfer_split RPC call. (binaryFate)
Diffstat (limited to 'src')
-rw-r--r--src/wallet/wallet_rpc_server.cpp7
-rw-r--r--src/wallet/wallet_rpc_server_commands_defs.h2
2 files changed, 9 insertions, 0 deletions
diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp
index 994743bf5..978e89f62 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);
}
diff --git a/src/wallet/wallet_rpc_server_commands_defs.h b/src/wallet/wallet_rpc_server_commands_defs.h
index 3c10dc41f..12ac281e4 100644
--- a/src/wallet/wallet_rpc_server_commands_defs.h
+++ b/src/wallet/wallet_rpc_server_commands_defs.h
@@ -180,11 +180,13 @@ namespace wallet_rpc
{
std::list<std::string> tx_hash_list;
std::list<std::string> tx_key_list;
+ std::list<uint64_t> amount_list;
std::list<uint64_t> fee_list;
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE(tx_hash_list)
KV_SERIALIZE(tx_key_list)
+ KV_SERIALIZE(amount_list)
KV_SERIALIZE(fee_list)
END_KV_SERIALIZE_MAP()
};