aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-03-30 19:21:30 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-04-04 18:10:45 +0000
commita2561653cbcba96e7e2dd352b9e0ea57cd220b2c (patch)
treeb41ef6e9785ddd3b46aa3aafff90605a8adc9b11 /src/rpc
parentMerge pull request #5318 (diff)
downloadmonero-a2561653cbcba96e7e2dd352b9e0ea57cd220b2c.tar.xz
wallet: new option to start background mining
The setup-background-mining option can be used to select background mining when a wallet loads. The user will be asked the first time the wallet is created.
Diffstat (limited to 'src/rpc')
-rw-r--r--src/rpc/core_rpc_server.cpp1
-rw-r--r--src/rpc/core_rpc_server_commands_defs.h6
2 files changed, 7 insertions, 0 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp
index f5f1a2f9a..039b82ade 100644
--- a/src/rpc/core_rpc_server.cpp
+++ b/src/rpc/core_rpc_server.cpp
@@ -939,6 +939,7 @@ namespace cryptonote
const miner& lMiner = m_core.get_miner();
res.active = lMiner.is_mining();
res.is_background_mining_enabled = lMiner.get_is_background_mining_enabled();
+ store_difficulty(m_core.get_blockchain_storage().get_difficulty_for_next_block(), res.difficulty, res.wide_difficulty, res.difficulty_top64);
res.block_target = m_core.get_blockchain_storage().get_current_hard_fork_version() < 2 ? DIFFICULTY_TARGET_V1 : DIFFICULTY_TARGET_V2;
if ( lMiner.is_mining() ) {
diff --git a/src/rpc/core_rpc_server_commands_defs.h b/src/rpc/core_rpc_server_commands_defs.h
index 1f14267f6..2a0181e93 100644
--- a/src/rpc/core_rpc_server_commands_defs.h
+++ b/src/rpc/core_rpc_server_commands_defs.h
@@ -821,6 +821,9 @@ namespace cryptonote
uint8_t bg_target;
uint32_t block_target;
uint64_t block_reward;
+ uint64_t difficulty;
+ std::string wide_difficulty;
+ uint64_t difficulty_top64;
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE(status)
@@ -836,6 +839,9 @@ namespace cryptonote
KV_SERIALIZE(bg_target)
KV_SERIALIZE(block_target)
KV_SERIALIZE(block_reward)
+ KV_SERIALIZE(difficulty)
+ KV_SERIALIZE(wide_difficulty)
+ KV_SERIALIZE(difficulty_top64)
END_KV_SERIALIZE_MAP()
};
typedef epee::misc_utils::struct_init<response_t> response;