aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cryptonote_basic/hardfork.cpp5
-rw-r--r--src/daemonizer/windows_daemonizer.inl10
-rw-r--r--src/wallet/wallet2.cpp2
-rw-r--r--src/wallet/wallet_rpc_server.cpp2
-rw-r--r--src/wallet/wallet_rpc_server_commands_defs.h6
5 files changed, 19 insertions, 6 deletions
diff --git a/src/cryptonote_basic/hardfork.cpp b/src/cryptonote_basic/hardfork.cpp
index d5710f727..98158a513 100644
--- a/src/cryptonote_basic/hardfork.cpp
+++ b/src/cryptonote_basic/hardfork.cpp
@@ -292,8 +292,7 @@ void HardFork::on_block_popped(uint64_t nblocks)
const uint64_t new_chain_height = db.height();
const uint64_t old_chain_height = new_chain_height + nblocks;
uint8_t version;
- uint64_t height;
- for (height = old_chain_height - 1; height >= new_chain_height; --height)
+ for (uint64_t height = old_chain_height - 1; height >= new_chain_height; --height)
{
version = versions.back();
last_versions[version]--;
@@ -305,7 +304,7 @@ void HardFork::on_block_popped(uint64_t nblocks)
// does not take voting into account
for (current_fork_index = heights.size() - 1; current_fork_index > 0; --current_fork_index)
- if (height >= heights[current_fork_index].height)
+ if (new_chain_height >= heights[current_fork_index].height)
break;
}
diff --git a/src/daemonizer/windows_daemonizer.inl b/src/daemonizer/windows_daemonizer.inl
index 701c098f6..c6cd474fd 100644
--- a/src/daemonizer/windows_daemonizer.inl
+++ b/src/daemonizer/windows_daemonizer.inl
@@ -61,6 +61,10 @@ namespace daemonizer
"run-as-service"
, "Hidden -- true if running as windows service"
};
+ const command_line::arg_descriptor<bool> arg_non_interactive = {
+ "non-interactive"
+ , "Run non-interactive"
+ };
std::string get_argument_string(int argc, char const * argv[])
{
@@ -83,6 +87,7 @@ namespace daemonizer
command_line::add_arg(normal_options, arg_start_service);
command_line::add_arg(normal_options, arg_stop_service);
command_line::add_arg(hidden_options, arg_is_service);
+ command_line::add_arg(hidden_options, arg_non_interactive);
}
inline boost::filesystem::path get_default_data_dir()
@@ -177,7 +182,10 @@ namespace daemonizer
else // interactive
{
//LOG_PRINT_L0("Monero '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL);
- return executor.run_interactive(vm);
+ if (command_line::has_arg(vm, arg_non_interactive))
+ return executor.run_non_interactive(vm);
+ else
+ return executor.run_interactive(vm);
}
return false;
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index 80068e1e7..3d5f1bd0f 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -3129,6 +3129,7 @@ void wallet2::refresh(bool trusted_daemon, uint64_t start_height, uint64_t & blo
}
});
+ auto scope_exit_handler_hwdev = epee::misc_utils::create_scope_leave_handler([&](){hwdev.computing_key_images(false);});
bool first = true;
while(m_run.load(std::memory_order_relaxed))
{
@@ -3254,7 +3255,6 @@ void wallet2::refresh(bool trusted_daemon, uint64_t start_height, uint64_t & blo
LOG_PRINT_L1("Failed to check pending transactions");
}
- hwdev.computing_key_images(false);
m_first_refresh_done = true;
LOG_PRINT_L1("Refresh done, blocks received: " << blocks_fetched << ", balance (all accounts): " << print_money(balance_all()) << ", unlocked: " << print_money(unlocked_balance_all()));
diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp
index aaad82bb7..4076ae957 100644
--- a/src/wallet/wallet_rpc_server.cpp
+++ b/src/wallet/wallet_rpc_server.cpp
@@ -1848,6 +1848,8 @@ namespace tools
rpc_transfers.tx_hash = epee::string_tools::pod_to_hex(td.m_txid);
rpc_transfers.subaddr_index = {td.m_subaddr_index.major, td.m_subaddr_index.minor};
rpc_transfers.key_image = td.m_key_image_known ? epee::string_tools::pod_to_hex(td.m_key_image) : "";
+ rpc_transfers.block_height = td.m_block_height;
+ rpc_transfers.frozen = td.m_frozen;
rpc_transfers.unlocked = m_wallet->is_transfer_unlocked(td);
res.transfers.push_back(rpc_transfers);
}
diff --git a/src/wallet/wallet_rpc_server_commands_defs.h b/src/wallet/wallet_rpc_server_commands_defs.h
index 604bc4175..4504ac752 100644
--- a/src/wallet/wallet_rpc_server_commands_defs.h
+++ b/src/wallet/wallet_rpc_server_commands_defs.h
@@ -47,7 +47,7 @@
// advance which version they will stop working with
// Don't go over 32767 for any of these
#define WALLET_RPC_VERSION_MAJOR 1
-#define WALLET_RPC_VERSION_MINOR 12
+#define WALLET_RPC_VERSION_MINOR 13
#define MAKE_WALLET_RPC_VERSION(major,minor) (((major)<<16)|(minor))
#define WALLET_RPC_VERSION MAKE_WALLET_RPC_VERSION(WALLET_RPC_VERSION_MAJOR, WALLET_RPC_VERSION_MINOR)
namespace tools
@@ -982,6 +982,8 @@ namespace wallet_rpc
std::string tx_hash;
cryptonote::subaddress_index subaddr_index;
std::string key_image;
+ uint64_t block_height;
+ bool frozen;
bool unlocked;
BEGIN_KV_SERIALIZE_MAP()
@@ -991,6 +993,8 @@ namespace wallet_rpc
KV_SERIALIZE(tx_hash)
KV_SERIALIZE(subaddr_index)
KV_SERIALIZE(key_image)
+ KV_SERIALIZE(block_height)
+ KV_SERIALIZE(frozen)
KV_SERIALIZE(unlocked)
END_KV_SERIALIZE_MAP()
};