aboutsummaryrefslogtreecommitdiff
path: root/src/wallet
diff options
context:
space:
mode:
Diffstat (limited to 'src/wallet')
-rw-r--r--src/wallet/wallet2.cpp4
-rw-r--r--src/wallet/wallet_rpc_server.cpp11
-rw-r--r--src/wallet/wallet_rpc_server_commands_defs.h3
3 files changed, 14 insertions, 4 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index a9a646b74..b6c10c0e5 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -213,7 +213,7 @@ void wallet2::process_new_transaction(const cryptonote::transaction& tx, uint64_
tx_pub_key = pub_key_field.pub_key;
bool r = true;
- int threads = boost::thread::hardware_concurrency();
+ int threads = tools::get_max_concurrency();
if (miner_tx && m_refresh_type == RefreshNoCoinbase)
{
// assume coinbase isn't for us
@@ -604,7 +604,7 @@ void wallet2::process_blocks(uint64_t start_height, const std::list<cryptonote::
size_t current_index = start_height;
blocks_added = 0;
- int threads = boost::thread::hardware_concurrency();
+ int threads = tools::get_max_concurrency();
if (threads > 1)
{
std::vector<crypto::hash> round_block_hashes(threads);
diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp
index 5b678fa38..a082f731b 100644
--- a/src/wallet/wallet_rpc_server.cpp
+++ b/src/wallet/wallet_rpc_server.cpp
@@ -842,10 +842,17 @@ namespace tools
return false;
}
+ uint64_t min_height = 0, max_height = (uint64_t)-1;
+ if (req.filter_by_height)
+ {
+ min_height = req.min_height;
+ max_height = req.max_height;
+ }
+
if (req.in)
{
std::list<std::pair<crypto::hash, tools::wallet2::payment_details>> payments;
- m_wallet.get_payments(payments, req.min_height, req.max_height);
+ m_wallet.get_payments(payments, min_height, max_height);
for (std::list<std::pair<crypto::hash, tools::wallet2::payment_details>>::const_iterator i = payments.begin(); i != payments.end(); ++i) {
res.in.push_back(wallet_rpc::COMMAND_RPC_GET_TRANSFERS::entry());
wallet_rpc::COMMAND_RPC_GET_TRANSFERS::entry &entry = res.in.back();
@@ -866,7 +873,7 @@ namespace tools
if (req.out)
{
std::list<std::pair<crypto::hash, tools::wallet2::confirmed_transfer_details>> payments;
- m_wallet.get_payments_out(payments, req.min_height, req.max_height);
+ m_wallet.get_payments_out(payments, min_height, max_height);
for (std::list<std::pair<crypto::hash, tools::wallet2::confirmed_transfer_details>>::const_iterator i = payments.begin(); i != payments.end(); ++i) {
res.in.push_back(wallet_rpc::COMMAND_RPC_GET_TRANSFERS::entry());
wallet_rpc::COMMAND_RPC_GET_TRANSFERS::entry &entry = res.in.back();
diff --git a/src/wallet/wallet_rpc_server_commands_defs.h b/src/wallet/wallet_rpc_server_commands_defs.h
index 9fe85dfc1..f8c04c007 100644
--- a/src/wallet/wallet_rpc_server_commands_defs.h
+++ b/src/wallet/wallet_rpc_server_commands_defs.h
@@ -496,6 +496,8 @@ namespace wallet_rpc
bool out;
bool pending;
bool failed;
+
+ bool filter_by_height;
uint64_t min_height;
uint64_t max_height;
@@ -504,6 +506,7 @@ namespace wallet_rpc
KV_SERIALIZE(out);
KV_SERIALIZE(pending);
KV_SERIALIZE(failed);
+ KV_SERIALIZE(filter_by_height);
KV_SERIALIZE(min_height);
KV_SERIALIZE(max_height);
END_KV_SERIALIZE_MAP()