aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md5
-rw-r--r--src/daemon/rpc_command_executor.cpp1
-rw-r--r--src/rpc/core_rpc_server.cpp9
-rw-r--r--src/rpc/core_rpc_server_commands_defs.h2
4 files changed, 16 insertions, 1 deletions
diff --git a/README.md b/README.md
index c34e0d36c..71b9a635e 100644
--- a/README.md
+++ b/README.md
@@ -177,3 +177,8 @@ See README.i18n
While Monero isn't made to integrate with Tor, it can be used wrapped with torsocks, if you add --p2p-bind-ip 127.0.0.1 to the bitmonerod command line.
Be aware that your DNS use will probably go over clearnet. These come in two flavours: request for checkpoint data, and request for OpenAlias data. The first one is mostly harmless (your ISP can tell you're using monero). The second one leaks information about your transaction recipients, so do not use OpenAlias if you want DNS privacy.
+## Using readline
+
+While bitmonerod and simplewallet do not use readline directly, most of the functionality can be obtained by running them via rlwrap. This allows command recall, edit capabilities, etc. It does not give autocompletion without an extra completion file, however. To use rlwrap, simply prepend "rlwrap " to the command line, eg:
+rlwrap bin/simplewallet --wallet-file /path/to/wallet
+
diff --git a/src/daemon/rpc_command_executor.cpp b/src/daemon/rpc_command_executor.cpp
index 686af69c2..9e7f3fdc3 100644
--- a/src/daemon/rpc_command_executor.cpp
+++ b/src/daemon/rpc_command_executor.cpp
@@ -241,6 +241,7 @@ bool t_rpc_command_executor::show_difficulty() {
}
tools::success_msg_writer() << "BH: " << res.height
+ << ", TH: " << res.top_block_hash
<< ", DIFF: " << res.difficulty
<< ", HR: " << (int) res.difficulty / res.target << " H/s";
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp
index e3e250a8e..57d3b0d0b 100644
--- a/src/rpc/core_rpc_server.cpp
+++ b/src/rpc/core_rpc_server.cpp
@@ -117,7 +117,14 @@ namespace cryptonote
bool core_rpc_server::on_get_info(const COMMAND_RPC_GET_INFO::request& req, COMMAND_RPC_GET_INFO::response& res)
{
CHECK_CORE_BUSY();
- res.height = m_core.get_current_blockchain_height();
+ crypto::hash top_hash;
+ if (!m_core.get_blockchain_top(res.height, top_hash))
+ {
+ res.status = "Failed";
+ return false;
+ }
+ ++res.height; // turn top block height into blockchain height
+ res.top_block_hash = string_tools::pod_to_hex(top_hash);
res.target_height = m_core.get_target_blockchain_height();
res.difficulty = m_core.get_blockchain_storage().get_difficulty_for_next_block();
res.target = m_core.get_blockchain_storage().get_current_hard_fork_version() < 2 ? DIFFICULTY_TARGET_V1 : DIFFICULTY_TARGET;
diff --git a/src/rpc/core_rpc_server_commands_defs.h b/src/rpc/core_rpc_server_commands_defs.h
index dbb274c50..5ad4450d4 100644
--- a/src/rpc/core_rpc_server_commands_defs.h
+++ b/src/rpc/core_rpc_server_commands_defs.h
@@ -282,6 +282,7 @@ namespace cryptonote
uint64_t white_peerlist_size;
uint64_t grey_peerlist_size;
bool testnet;
+ std::string top_block_hash;
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE(status)
@@ -296,6 +297,7 @@ namespace cryptonote
KV_SERIALIZE(white_peerlist_size)
KV_SERIALIZE(grey_peerlist_size)
KV_SERIALIZE(testnet)
+ KV_SERIALIZE(top_block_hash)
END_KV_SERIALIZE_MAP()
};
};