diff --git a/src/wallet/wallet_public_structs_defs.h b/src/wallet/wallet_public_structs_defs.h index 48251797..f93242e3 100644 --- a/src/wallet/wallet_public_structs_defs.h +++ b/src/wallet/wallet_public_structs_defs.h @@ -259,6 +259,7 @@ namespace wallet_public uint64_t transfer_entries_count; bool is_whatch_only; std::vector utxo_distribution; + uint64_t current_height; BEGIN_KV_SERIALIZE_MAP() KV_SERIALIZE(address) @@ -267,6 +268,8 @@ namespace wallet_public KV_SERIALIZE(transfer_entries_count) KV_SERIALIZE(is_whatch_only) KV_SERIALIZE(utxo_distribution) + KV_SERIALIZE(current_height) + KV_SERIALIZE_POD_AS_HEX_STRING(last_block_id) END_KV_SERIALIZE_MAP() }; }; @@ -304,6 +307,7 @@ namespace wallet_public uint64_t transfer_entries_count; uint64_t balance; uint64_t unlocked_balance; + uint64_t curent_height; BEGIN_KV_SERIALIZE_MAP() @@ -311,6 +315,7 @@ namespace wallet_public KV_SERIALIZE(transfer_entries_count) KV_SERIALIZE(balance) KV_SERIALIZE(unlocked_balance) + KV_SERIALIZE(curent_height) END_KV_SERIALIZE_MAP() }; diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp index 71d34fa1..4f581e22 100644 --- a/src/wallet/wallet_rpc_server.cpp +++ b/src/wallet/wallet_rpc_server.cpp @@ -208,6 +208,7 @@ namespace tools for (const auto& ent : distribution) res.utxo_distribution.push_back(currency::print_money_brief(ent.first) + ":" + std::to_string(ent.second)); + res.current_height = m_wallet.get_top_block_height(); return true; } catch (std::exception& e) @@ -245,6 +246,7 @@ namespace tools res.pi.balance = m_wallet.balance(res.pi.unlocked_balance); res.pi.transfer_entries_count = m_wallet.get_transfer_entries_count(); res.pi.transfers_count = m_wallet.get_recent_transfers_total_count(); + res.pi.curent_height = m_wallet.get_top_block_height(); } if (req.offset == 0) diff --git a/src/wallet/wallet_rpc_server.h b/src/wallet/wallet_rpc_server.h index 2d94bc52..3c75296e 100644 --- a/src/wallet/wallet_rpc_server.h +++ b/src/wallet/wallet_rpc_server.h @@ -66,10 +66,10 @@ namespace tools MAP_JON_RPC_WE("marketplace_push_update_offer", on_marketplace_push_update_offer, wallet_public::COMMAND_MARKETPLACE_PUSH_UPDATE_OFFER) MAP_JON_RPC_WE("marketplace_cancel_offer", on_marketplace_cancel_offer, wallet_public::COMMAND_MARKETPLACE_CANCEL_OFFER) //HTLC API - MAP_JON_RPC_WE("atomics_create_htlc_proposal", on_create_htlc_proposal, wallet_public::COMMAND_CREATE_HTLC_PROPOSAL) - MAP_JON_RPC_WE("atomics_get_list_of_active_htlc", on_get_list_of_active_htlc, wallet_public::COMMAND_GET_LIST_OF_ACTIVE_HTLC) - MAP_JON_RPC_WE("atomics_redeem_htlc", on_redeem_htlc, wallet_public::COMMAND_REDEEM_HTLC) - MAP_JON_RPC_WE("atomics_check_htlc_redeemed", on_check_htlc_redeemed, wallet_public::COMMAND_CHECK_HTLC_REDEEMED) + MAP_JON_RPC_WE("atomics_create_htlc_proposal", on_create_htlc_proposal, wallet_public::COMMAND_CREATE_HTLC_PROPOSAL) + MAP_JON_RPC_WE("atomics_get_list_of_active_htlc", on_get_list_of_active_htlc, wallet_public::COMMAND_GET_LIST_OF_ACTIVE_HTLC) + MAP_JON_RPC_WE("atomics_redeem_htlc", on_redeem_htlc, wallet_public::COMMAND_REDEEM_HTLC) + MAP_JON_RPC_WE("atomics_check_htlc_redeemed", on_check_htlc_redeemed, wallet_public::COMMAND_CHECK_HTLC_REDEEMED) END_JSON_RPC_MAP() END_URI_MAP2()