aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cryptonote_core/blockchain.h5
-rw-r--r--src/cryptonote_protocol/cryptonote_protocol_handler.inl2
-rw-r--r--src/mnemonics/electrum-words.cpp5
-rw-r--r--src/mnemonics/electrum-words.h2
-rw-r--r--src/p2p/net_node.inl16
-rw-r--r--src/p2p/net_peerlist_boost_serialization.h12
-rw-r--r--src/p2p/p2p_protocol_defs.h4
-rw-r--r--src/rpc/core_rpc_server.cpp4
-rw-r--r--src/simplewallet/simplewallet.cpp35
-rw-r--r--src/wallet/wallet2.cpp26
-rw-r--r--src/wallet/wallet_rpc_server.cpp13
-rw-r--r--src/wallet/wallet_rpc_server.h2
-rw-r--r--src/wallet/wallet_rpc_server_commands_defs.h2
13 files changed, 70 insertions, 58 deletions
diff --git a/src/cryptonote_core/blockchain.h b/src/cryptonote_core/blockchain.h
index 56373adf9..4f2e4f0d3 100644
--- a/src/cryptonote_core/blockchain.h
+++ b/src/cryptonote_core/blockchain.h
@@ -689,16 +689,15 @@ namespace cryptonote
// user options, must be called before calling init()
- //FIXME: parameter names don't match function definition in .cpp file
/**
* @brief sets various performance options
*
- * @param block_threads max number of threads when preparing blocks for addition
+ * @param maxthreads max number of threads when preparing blocks for addition
* @param blocks_per_sync number of blocks to cache before syncing to database
* @param sync_mode the ::blockchain_db_sync_mode to use
* @param fast_sync sync using built-in block hashes as trusted
*/
- void set_user_options(uint64_t block_threads, uint64_t blocks_per_sync,
+ void set_user_options(uint64_t maxthreads, uint64_t blocks_per_sync,
blockchain_db_sync_mode sync_mode, bool fast_sync);
/**
diff --git a/src/cryptonote_protocol/cryptonote_protocol_handler.inl b/src/cryptonote_protocol/cryptonote_protocol_handler.inl
index 0b99aa7bd..c5bc834ad 100644
--- a/src/cryptonote_protocol/cryptonote_protocol_handler.inl
+++ b/src/cryptonote_protocol/cryptonote_protocol_handler.inl
@@ -192,7 +192,7 @@ namespace cryptonote
cnx.host = cntxt.m_remote_address.host_str();
cnx.ip = "";
cnx.port = "";
- if (cntxt.m_remote_address.type() == typeid(epee::net_utils::ipv4_network_address))
+ if (cntxt.m_remote_address.get_type_id() == epee::net_utils::ipv4_network_address::ID)
{
cnx.ip = cnx.host;
cnx.port = std::to_string(cntxt.m_remote_address.as<epee::net_utils::ipv4_network_address>().port());
diff --git a/src/mnemonics/electrum-words.cpp b/src/mnemonics/electrum-words.cpp
index ef1100a10..3b1dc53d7 100644
--- a/src/mnemonics/electrum-words.cpp
+++ b/src/mnemonics/electrum-words.cpp
@@ -422,10 +422,11 @@ namespace crypto
* \param seed The seed to check (a space delimited concatenated word list)
* \return true if the seed passed is a old style seed false if not.
*/
- bool get_is_old_style_seed(const std::string &seed)
+ bool get_is_old_style_seed(std::string seed)
{
std::vector<std::string> word_list;
- boost::split(word_list, seed, boost::is_any_of(" "));
+ boost::algorithm::trim(seed);
+ boost::split(word_list, seed, boost::is_any_of(" "), boost::token_compress_on);
return word_list.size() != (seed_length + 1);
}
diff --git a/src/mnemonics/electrum-words.h b/src/mnemonics/electrum-words.h
index 3655dd201..94ce9c200 100644
--- a/src/mnemonics/electrum-words.h
+++ b/src/mnemonics/electrum-words.h
@@ -92,7 +92,7 @@ namespace crypto
* \param seed The seed to check (a space delimited concatenated word list)
* \return true if the seed passed is a old style seed false if not.
*/
- bool get_is_old_style_seed(const std::string &seed);
+ bool get_is_old_style_seed(std::string seed);
}
}
diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl
index c250d5185..b23090c7d 100644
--- a/src/p2p/net_node.inl
+++ b/src/p2p/net_node.inl
@@ -939,8 +939,8 @@ namespace nodetool
<< (last_seen_stamp ? epee::misc_utils::get_time_interval_string(time(NULL) - last_seen_stamp):"never")
<< ")...");
- CHECK_AND_ASSERT_MES(na.type() == typeid(epee::net_utils::ipv4_network_address), false,
- "Only IPv4 addresses are supported here, got " << na.type().name());
+ CHECK_AND_ASSERT_MES(na.get_type_id() == epee::net_utils::ipv4_network_address::ID, false,
+ "Only IPv4 addresses are supported here");
const epee::net_utils::ipv4_network_address &ipv4 = na.as<const epee::net_utils::ipv4_network_address>();
typename net_server::t_connection_context con = AUTO_VAL_INIT(con);
@@ -1004,8 +1004,8 @@ namespace nodetool
<< (last_seen_stamp ? epee::misc_utils::get_time_interval_string(time(NULL) - last_seen_stamp):"never")
<< ")...");
- CHECK_AND_ASSERT_MES(na.type() == typeid(epee::net_utils::ipv4_network_address), false,
- "Only IPv4 addresses are supported here, got " << na.type().name());
+ CHECK_AND_ASSERT_MES(na.get_type_id() == epee::net_utils::ipv4_network_address::ID, false,
+ "Only IPv4 addresses are supported here");
const epee::net_utils::ipv4_network_address &ipv4 = na.as<epee::net_utils::ipv4_network_address>();
typename net_server::t_connection_context con = AUTO_VAL_INIT(con);
@@ -1510,8 +1510,8 @@ namespace nodetool
if(!node_data.my_port)
return false;
- CHECK_AND_ASSERT_MES(context.m_remote_address.type() == typeid(epee::net_utils::ipv4_network_address), false,
- "Only IPv4 addresses are supported here, got " << context.m_remote_address.type().name());
+ CHECK_AND_ASSERT_MES(context.m_remote_address.get_type_id() == epee::net_utils::ipv4_network_address::ID, false,
+ "Only IPv4 addresses are supported here");
const epee::net_utils::network_address na = context.m_remote_address;
uint32_t actual_ip = na.as<const epee::net_utils::ipv4_network_address>().ip();
@@ -1670,8 +1670,8 @@ namespace nodetool
//try ping to be sure that we can add this peer to peer_list
try_ping(arg.node_data, context, [peer_id_l, port_l, context, this]()
{
- CHECK_AND_ASSERT_MES(context.m_remote_address.type() == typeid(epee::net_utils::ipv4_network_address), void(),
- "Only IPv4 addresses are supported here, got " << context.m_remote_address.type().name());
+ CHECK_AND_ASSERT_MES(context.m_remote_address.get_type_id() == epee::net_utils::ipv4_network_address::ID, void(),
+ "Only IPv4 addresses are supported here");
//called only(!) if success pinged, update local peerlist
peerlist_entry pe;
const epee::net_utils::network_address na = context.m_remote_address;
diff --git a/src/p2p/net_peerlist_boost_serialization.h b/src/p2p/net_peerlist_boost_serialization.h
index 0a21895cf..43c5ea5f0 100644
--- a/src/p2p/net_peerlist_boost_serialization.h
+++ b/src/p2p/net_peerlist_boost_serialization.h
@@ -36,24 +36,16 @@ namespace boost
{
namespace serialization
{
- enum { sertype_ipv4_address };
- static inline uint8_t get_type(const epee::net_utils::network_address &na)
- {
- if (na.type() == typeid(epee::net_utils::ipv4_network_address))
- return sertype_ipv4_address;
- throw std::runtime_error("Unsupported network address type");
- return 0;
- }
template <class Archive, class ver_type>
inline void serialize(Archive &a, epee::net_utils::network_address& na, const ver_type ver)
{
uint8_t type;
if (typename Archive::is_saving())
- type = get_type(na);
+ type = na.get_type_id();
a & type;
switch (type)
{
- case sertype_ipv4_address:
+ case epee::net_utils::ipv4_network_address::ID:
if (!typename Archive::is_saving())
na.reset(new epee::net_utils::ipv4_network_address(0, 0));
a & na.as<epee::net_utils::ipv4_network_address>();
diff --git a/src/p2p/p2p_protocol_defs.h b/src/p2p/p2p_protocol_defs.h
index d60990f8a..a471211a6 100644
--- a/src/p2p/p2p_protocol_defs.h
+++ b/src/p2p/p2p_protocol_defs.h
@@ -188,7 +188,7 @@ namespace nodetool
std::list<peerlist_entry_base<network_address_old>> local_peerlist;
for (const auto &p: this_ref.local_peerlist_new)
{
- if (p.adr.type() == typeid(epee::net_utils::ipv4_network_address))
+ if (p.adr.get_type_id() == epee::net_utils::ipv4_network_address::ID)
{
const epee::net_utils::network_address &na = p.adr;
const epee::net_utils::ipv4_network_address &ipv4 = na.as<const epee::net_utils::ipv4_network_address>();
@@ -247,7 +247,7 @@ namespace nodetool
std::list<peerlist_entry_base<network_address_old>> local_peerlist;
for (const auto &p: this_ref.local_peerlist_new)
{
- if (p.adr.type() == typeid(epee::net_utils::ipv4_network_address))
+ if (p.adr.get_type_id() == epee::net_utils::ipv4_network_address::ID)
{
const epee::net_utils::network_address &na = p.adr;
const epee::net_utils::ipv4_network_address &ipv4 = na.as<const epee::net_utils::ipv4_network_address>();
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp
index 18d1cea75..97fe18696 100644
--- a/src/rpc/core_rpc_server.cpp
+++ b/src/rpc/core_rpc_server.cpp
@@ -736,7 +736,7 @@ namespace cryptonote
for (auto & entry : white_list)
{
- if (entry.adr.type() == typeid(epee::net_utils::ipv4_network_address))
+ if (entry.adr.get_type_id() == epee::net_utils::ipv4_network_address::ID)
res.white_list.emplace_back(entry.id, entry.adr.as<epee::net_utils::ipv4_network_address>().ip(),
entry.adr.as<epee::net_utils::ipv4_network_address>().port(), entry.last_seen);
else
@@ -745,7 +745,7 @@ namespace cryptonote
for (auto & entry : gray_list)
{
- if (entry.adr.type() == typeid(epee::net_utils::ipv4_network_address))
+ if (entry.adr.get_type_id() == epee::net_utils::ipv4_network_address::ID)
res.gray_list.emplace_back(entry.id, entry.adr.as<epee::net_utils::ipv4_network_address>().ip(),
entry.adr.as<epee::net_utils::ipv4_network_address>().port(), entry.last_seen);
else
diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp
index 85ea07e94..c1f2d3495 100644
--- a/src/simplewallet/simplewallet.cpp
+++ b/src/simplewallet/simplewallet.cpp
@@ -62,6 +62,15 @@
#include "wallet/wallet_args.h"
#include <stdexcept>
+#ifdef HAVE_READLINE
+ #include "readline_buffer.h"
+ #define PAUSE_READLINE() \
+ rdln::suspend_readline pause_readline; \
+ std::cout << std::endl
+#else
+ #define PAUSE_READLINE()
+#endif
+
using namespace std;
using namespace epee;
using namespace cryptonote;
@@ -711,14 +720,14 @@ simple_wallet::simple_wallet()
m_cmd_binder.set_handler("viewkey", boost::bind(&simple_wallet::viewkey, this, _1), tr("Display private view key"));
m_cmd_binder.set_handler("spendkey", boost::bind(&simple_wallet::spendkey, this, _1), tr("Display private spend key"));
m_cmd_binder.set_handler("seed", boost::bind(&simple_wallet::seed, this, _1), tr("Display Electrum-style mnemonic seed"));
- m_cmd_binder.set_handler("set", boost::bind(&simple_wallet::set_variable, this, _1), tr("Available options: seed language - set wallet seed language; always-confirm-transfers <1|0> - whether to confirm unsplit txes; print-ring-members <1|0> - whether to print detailed information about ring members during confirmation; store-tx-info <1|0> - whether to store outgoing tx info (destination address, payment ID, tx secret key) for future reference; default-mixin <n> - set default mixin (default is 4); auto-refresh <1|0> - whether to automatically sync new blocks from the daemon; refresh-type <full|optimize-coinbase|no-coinbase|default> - set wallet refresh behaviour; priority [0|1|2|3|4] - default/unimportant/normal/elevated/priority fee; confirm-missing-payment-id <1|0>; ask-password <1|0>; unit <monero|millinero|micronero|nanonero|piconero> - set default monero (sub-)unit; min-outputs-count [n] - try to keep at least that many outputs of value at least min-outputs-value; min-outputs-value [n] - try to keep at least min-outputs-count outputs of at least that value - merge-destinations <1|0> - whether to merge multiple payments to the same destination address"));
+ m_cmd_binder.set_handler("set", boost::bind(&simple_wallet::set_variable, this, _1), tr("Available options: seed language - set wallet seed language; always-confirm-transfers <1|0> - whether to confirm unsplit txes; print-ring-members <1|0> - whether to print detailed information about ring members during confirmation; store-tx-info <1|0> - whether to store outgoing tx info (destination address, payment ID, tx secret key) for future reference; default-mixin <n> - set default mixin (default is 4); auto-refresh <1|0> - whether to automatically sync new blocks from the daemon; refresh-type <full|optimize-coinbase|no-coinbase|default> - set wallet refresh behaviour; priority [0|1|2|3|4] - default/unimportant/normal/elevated/priority fee; confirm-missing-payment-id <1|0>; ask-password <1|0>; unit <monero|millinero|micronero|nanonero|piconero> - set default monero (sub-)unit; min-outputs-count [n] - try to keep at least that many outputs of value at least min-outputs-value; min-outputs-value [n] - try to keep at least min-outputs-count outputs of at least that value; merge-destinations <1|0> - whether to merge multiple payments to the same destination address"));
m_cmd_binder.set_handler("rescan_spent", boost::bind(&simple_wallet::rescan_spent, this, _1), tr("Rescan blockchain for spent outputs"));
m_cmd_binder.set_handler("get_tx_key", boost::bind(&simple_wallet::get_tx_key, this, _1), tr("Get transaction key (r) for a given <txid>"));
m_cmd_binder.set_handler("check_tx_key", boost::bind(&simple_wallet::check_tx_key, this, _1), tr("Check amount going to <address> in <txid>"));
m_cmd_binder.set_handler("get_tx_proof", boost::bind(&simple_wallet::get_tx_proof, this, _1), tr("Generate a signature to prove payment to <address> in <txid> using the transaction secret key (r) without revealing it"));
m_cmd_binder.set_handler("check_tx_proof", boost::bind(&simple_wallet::check_tx_proof, this, _1), tr("Check tx proof for payment going to <address> in <txid>"));
m_cmd_binder.set_handler("show_transfers", boost::bind(&simple_wallet::show_transfers, this, _1), tr("show_transfers [in|out|pending|failed|pool] [<min_height> [<max_height>]] - Show incoming/outgoing transfers within an optional height range"));
- m_cmd_binder.set_handler("unspent_outputs", boost::bind(&simple_wallet::unspent_outputs, this, _1), tr("unspent_outputs [<min_amount> <max_amount>] - Show unspent outputs within an optional amount range)"));
+ m_cmd_binder.set_handler("unspent_outputs", boost::bind(&simple_wallet::unspent_outputs, this, _1), tr("unspent_outputs [<min_amount> <max_amount>] - Show unspent outputs within an optional amount range"));
m_cmd_binder.set_handler("rescan_bc", boost::bind(&simple_wallet::rescan_blockchain, this, _1), tr("Rescan blockchain from scratch"));
m_cmd_binder.set_handler("set_tx_note", boost::bind(&simple_wallet::set_tx_note, this, _1), tr("Set an arbitrary string note for a txid"));
m_cmd_binder.set_handler("get_tx_note", boost::bind(&simple_wallet::get_tx_note, this, _1), tr("Get a string note for a txid"));
@@ -794,7 +803,7 @@ bool simple_wallet::set_variable(const std::vector<std::string> &args)
CHECK_SIMPLE_VARIABLE("priority", set_default_priority, tr("0, 1, 2, 3, or 4"));
CHECK_SIMPLE_VARIABLE("confirm-missing-payment-id", set_confirm_missing_payment_id, tr("0 or 1"));
CHECK_SIMPLE_VARIABLE("ask-password", set_ask_password, tr("0 or 1"));
- CHECK_SIMPLE_VARIABLE("unit", set_unit, tr("monero, millinero, micronero, nanop, piconero"));
+ CHECK_SIMPLE_VARIABLE("unit", set_unit, tr("monero, millinero, micronero, nanonero, piconero"));
CHECK_SIMPLE_VARIABLE("min-outputs-count", set_min_output_count, tr("unsigned integer"));
CHECK_SIMPLE_VARIABLE("min-outputs-value", set_min_output_value, tr("amount"));
CHECK_SIMPLE_VARIABLE("merge-destinations", set_merge_destinations, tr("0 or 1"));
@@ -920,8 +929,6 @@ static bool might_be_partial_seed(std::string words)
//----------------------------------------------------------------------------------------------------
bool simple_wallet::init(const boost::program_options::variables_map& vm)
{
- bool need_refresh_height = false;
-
if (!handle_command_line(vm))
return false;
@@ -1119,8 +1126,6 @@ bool simple_wallet::init(const boost::program_options::variables_map& vm)
m_wallet_file = m_generate_new;
bool r = new_wallet(vm, m_recovery_key, m_restore_deterministic_wallet, m_non_deterministic, old_language);
CHECK_AND_ASSERT_MES(r, false, tr("account creation failed"));
- if (!m_restore_deterministic_wallet)
- need_refresh_height = true;
}
if (!m_restore_height && m_restoring)
{
@@ -1213,14 +1218,6 @@ bool simple_wallet::init(const boost::program_options::variables_map& vm)
m_http_client.set_server(m_wallet->get_daemon_address(), m_wallet->get_daemon_login());
m_wallet->callback(this);
- if (need_refresh_height)
- {
- // for a totally new account, we don't care about older blocks.
- MDEBUG("Calling daemon to set refresh height");
- std::string err;
- m_wallet->set_refresh_from_block_height(get_daemon_blockchain_height(err));
- }
-
return true;
}
//----------------------------------------------------------------------------------------------------
@@ -1831,6 +1828,8 @@ bool simple_wallet::show_incoming_transfers(const std::vector<std::string>& args
}
}
+ PAUSE_READLINE();
+
tools::wallet2::transfer_container transfers;
m_wallet->get_transfers(transfers);
@@ -1891,6 +1890,8 @@ bool simple_wallet::show_payments(const std::vector<std::string> &args)
LOCK_IDLE_SCOPE();
+ PAUSE_READLINE();
+
message_writer() << boost::format("%68s%68s%12s%21s%16s") %
tr("payment") % tr("transaction") % tr("height") % tr("amount") % tr("unlock time");
@@ -2101,7 +2102,7 @@ bool simple_wallet::print_ring_members(const std::vector<tools::wallet2::pending
{
ostr
<< tr("\nWarning: Some input keys being spent are from ")
- << tr(are_keys_from_same_tx ? "the same transaction" : "blocks that are temporally very close")
+ << (are_keys_from_same_tx ? tr("the same transaction") : tr("blocks that are temporally very close"))
<< tr(", which can break the anonymity of ring signature. Make sure this is intentional!");
}
ostr << ENDL;
@@ -3718,6 +3719,8 @@ bool simple_wallet::show_transfers(const std::vector<std::string> &args_)
std::multimap<uint64_t, std::pair<bool,std::string>> output;
+ PAUSE_READLINE();
+
if (in) {
std::list<std::pair<crypto::hash, tools::wallet2::payment_details>> payments;
m_wallet->get_payments(payments, min_height, max_height);
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index ee2b6055c..6b1026a55 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -1601,7 +1601,7 @@ void wallet2::fast_refresh(uint64_t stop_height, uint64_t &blocks_start_height,
while(m_run.load(std::memory_order_relaxed) && current_index < stop_height)
{
pull_hashes(0, blocks_start_height, short_chain_history, hashes);
- if (hashes.size() < 3)
+ if (hashes.size() <= 3)
return;
if (hashes.size() + current_index < stop_height) {
std::list<crypto::hash>::iterator right;
@@ -2165,14 +2165,23 @@ crypto::secret_key wallet2::generate(const std::string& wallet_, const std::stri
m_account_public_address = m_account.get_keys().m_account_address;
m_watch_only = false;
+ // -1 month for fluctuations in block time and machine date/time setup.
+ // avg seconds per block
+ const int seconds_per_block = DIFFICULTY_TARGET_V2;
+ // ~num blocks per month
+ const uint64_t blocks_per_month = 60*60*24*30/seconds_per_block;
+
+ // try asking the daemon first
+ if(m_refresh_from_block_height == 0 && !recover){
+ std::string err;
+ uint64_t height = get_daemon_blockchain_height(err);
+ if (err.empty())
+ m_refresh_from_block_height = height - blocks_per_month;
+ }
+
if(m_refresh_from_block_height == 0 && !recover){
// Wallets created offline don't know blockchain height.
// Set blockchain height calculated from current date/time
- // -1 month for fluctuations in block time and machine date/time setup.
- // avg seconds per block
- const int seconds_per_block = DIFFICULTY_TARGET_V2;
- // ~num blocks per month
- const uint64_t blocks_per_month = 60*60*24*30/seconds_per_block;
uint64_t approx_blockchain_height = get_approximate_blockchain_height();
if(approx_blockchain_height > 0) {
m_refresh_from_block_height = approx_blockchain_height - blocks_per_month;
@@ -5010,11 +5019,10 @@ uint64_t wallet2::get_daemon_blockchain_target_height(string &err)
uint64_t wallet2::get_approximate_blockchain_height() const
{
- if (m_testnet) return 0;
// time of v2 fork
- const time_t fork_time = 1458748658;
+ const time_t fork_time = m_testnet ? 1448285909 : 1458748658;
// v2 fork block
- const uint64_t fork_block = 1009827;
+ const uint64_t fork_block = m_testnet ? 624634 : 1009827;
// avg seconds per block
const int seconds_per_block = DIFFICULTY_TARGET_V2;
// Calculated blockchain height
diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp
index f2b3dcaf5..e7b9b5a71 100644
--- a/src/wallet/wallet_rpc_server.cpp
+++ b/src/wallet/wallet_rpc_server.cpp
@@ -422,7 +422,7 @@ namespace tools
std::vector<cryptonote::tx_destination_entry> dsts;
std::vector<uint8_t> extra;
- LOG_PRINT_L3("on_transfer_split starts");
+ LOG_PRINT_L3("on_transfer starts");
if (!m_wallet) return not_open(er);
if (m_wallet->restricted())
{
@@ -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;
@@ -518,9 +519,9 @@ namespace tools
ptx_vector = m_wallet->create_transactions_2(dsts, mixin, req.unlock_time, req.priority, extra, m_trusted_daemon);
LOG_PRINT_L2("on_transfer_split called create_transactions_2");
- LOG_PRINT_L2("on_transfer_split calling commit_txyy");
+ LOG_PRINT_L2("on_transfer_split calling commit_tx");
m_wallet->commit_tx(ptx_vector);
- LOG_PRINT_L2("on_transfer_split called commit_txyy");
+ LOG_PRINT_L2("on_transfer_split called commit_tx");
// populate response with tx hashes
for (auto & ptx : ptx_vector)
@@ -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.h b/src/wallet/wallet_rpc_server.h
index 230dcee5b..68e4c049a 100644
--- a/src/wallet/wallet_rpc_server.h
+++ b/src/wallet/wallet_rpc_server.h
@@ -149,7 +149,7 @@ namespace tools
void fill_transfer_entry(tools::wallet_rpc::transfer_entry &entry, const crypto::hash &txid, const tools::wallet2::confirmed_transfer_details &pd);
void fill_transfer_entry(tools::wallet_rpc::transfer_entry &entry, const crypto::hash &txid, const tools::wallet2::unconfirmed_transfer_details &pd);
void fill_transfer_entry(tools::wallet_rpc::transfer_entry &entry, const crypto::hash &payment_id, const tools::wallet2::payment_details &pd);
- bool not_open(epee::json_rpc::error& er);
+ bool not_open(epee::json_rpc::error& er);
wallet2 *m_wallet;
std::string m_wallet_dir;
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()
};