diff options
author | Riccardo Spagni <ric@spagni.net> | 2018-12-12 11:58:36 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2018-12-12 11:58:37 +0200 |
commit | 0fccc78e3966477309cb4e9c037c0a9f004ea99e (patch) | |
tree | 5ec83c8705bc716c5efd497b85069e256a5401d8 /src/rpc/core_rpc_server.cpp | |
parent | Merge pull request #4901 (diff) | |
parent | add command pop_blocks (diff) | |
download | monero-0fccc78e3966477309cb4e9c037c0a9f004ea99e.tar.xz |
Merge pull request #4903
dc1c1252 add command pop_blocks (Jason Wong)
Diffstat (limited to 'src/rpc/core_rpc_server.cpp')
-rw-r--r-- | src/rpc/core_rpc_server.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp index cefba39f7..3851af3c8 100644 --- a/src/rpc/core_rpc_server.cpp +++ b/src/rpc/core_rpc_server.cpp @@ -2032,6 +2032,18 @@ namespace cryptonote return true; } //------------------------------------------------------------------------------------------------------------------------------ + bool core_rpc_server::on_pop_blocks(const COMMAND_RPC_POP_BLOCKS::request& req, COMMAND_RPC_POP_BLOCKS::response& res) + { + PERF_TIMER(on_pop_blocks); + + m_core.get_blockchain_storage().pop_blocks(req.nblocks); + + res.height = m_core.get_current_blockchain_height(); + res.status = CORE_RPC_STATUS_OK; + + return true; + } + //------------------------------------------------------------------------------------------------------------------------------ bool core_rpc_server::on_relay_tx(const COMMAND_RPC_RELAY_TX::request& req, COMMAND_RPC_RELAY_TX::response& res, epee::json_rpc::error& error_resp) { PERF_TIMER(on_relay_tx); |