diff options
author | Riccardo Spagni <ric@spagni.net> | 2015-12-25 21:48:22 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2015-12-25 21:48:25 +0200 |
commit | 719a6a89c63506f129036b07c519dcbd770aeffb (patch) | |
tree | 1dc9792e843f859d74b08e4e06fde923f1d8c63e /src/wallet/wallet_rpc_server.cpp | |
parent | Merge pull request #560 (diff) | |
parent | changed height to uint64_t (diff) | |
download | monero-719a6a89c63506f129036b07c519dcbd770aeffb.tar.xz |
Merge pull request #557
791e7fb changed height to uint64_t (Brendan Telzrow)
4cd7913 added RPC wallet command getheight (Brendan Telzrow)
Diffstat (limited to 'src/wallet/wallet_rpc_server.cpp')
-rw-r--r-- | src/wallet/wallet_rpc_server.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp index 026b78d2e..a1f48bd77 100644 --- a/src/wallet/wallet_rpc_server.cpp +++ b/src/wallet/wallet_rpc_server.cpp @@ -115,7 +115,21 @@ namespace tools } return true; } - + //------------------------------------------------------------------------------------------------------------------------------ + bool wallet_rpc_server::on_getheight(const wallet_rpc::COMMAND_RPC_GET_HEIGHT::request& req, wallet_rpc::COMMAND_RPC_GET_HEIGHT::response& res, epee::json_rpc::error& er) + { + try + { + res.height = m_wallet.get_blockchain_current_height(); + } + catch (std::exception& e) + { + er.code = WALLET_RPC_ERROR_CODE_UNKNOWN_ERROR; + er.message = e.what(); + return false; + } + return true; + } //------------------------------------------------------------------------------------------------------------------------------ bool wallet_rpc_server::validate_transfer(const std::list<wallet_rpc::transfer_destination> destinations, std::string payment_id, std::vector<cryptonote::tx_destination_entry>& dsts, std::vector<uint8_t>& extra, epee::json_rpc::error& er) { @@ -652,3 +666,4 @@ namespace tools } //------------------------------------------------------------------------------------------------------------------------------ } + |