aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet_rpc_server.cpp
diff options
context:
space:
mode:
authortobtoht <tob@featherwallet.org>2025-02-16 05:23:11 +0000
committertobtoht <tob@featherwallet.org>2025-02-16 05:23:11 +0000
commit505b1892485d56cf9f2dfb0f6eab04776857cd16 (patch)
tree071ebfca9c6ac7aa404591375287354555bd22ca /src/wallet/wallet_rpc_server.cpp
parentbe0efaf7f6a97d437381b7988f6dfcedb89cb4af (diff)
parentd14c3ca3d2d10616950ec6e38b33378851cb84e0 (diff)
downloadmonzero-core-505b1892485d56cf9f2dfb0f6eab04776857cd16.tar.gz
monzero-core-505b1892485d56cf9f2dfb0f6eab04776857cd16.tar.xz
monzero-core-505b1892485d56cf9f2dfb0f6eab04776857cd16.zip
Merge pull request #9788
d14c3ca3d add wallet rpc call to get default fee priority (woodser)
Diffstat (limited to 'src/wallet/wallet_rpc_server.cpp')
-rw-r--r--src/wallet/wallet_rpc_server.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp
index b84b7b284..3188c88db 100644
--- a/src/wallet/wallet_rpc_server.cpp
+++ b/src/wallet/wallet_rpc_server.cpp
@@ -4732,6 +4732,29 @@ namespace tools
return true;
}
//------------------------------------------------------------------------------------------------------------------------------
+ bool wallet_rpc_server::on_get_default_fee_priority(const wallet_rpc::COMMAND_RPC_GET_DEFAULT_FEE_PRIORITY::request& req, wallet_rpc::COMMAND_RPC_GET_DEFAULT_FEE_PRIORITY::response& res, epee::json_rpc::error& er, const connection_context *ctx)
+ {
+ if (!m_wallet) return not_open(er);
+ try
+ {
+ uint32_t priority = m_wallet->adjust_priority(0);
+ if (priority == 0)
+ {
+ er.code = WALLET_RPC_ERROR_CODE_UNKNOWN_ERROR;
+ er.message = "Failed to get adjusted fee priority";
+ return false;
+ }
+ res.priority = priority;
+ }
+ catch (const std::exception& e)
+ {
+ er.code = WALLET_RPC_ERROR_CODE_UNKNOWN_ERROR;
+ er.message = "Failed to get adjusted fee priority";
+ return false;
+ }
+ return true;
+ }
+ //------------------------------------------------------------------------------------------------------------------------------
bool wallet_rpc_server::on_get_version(const wallet_rpc::COMMAND_RPC_GET_VERSION::request& req, wallet_rpc::COMMAND_RPC_GET_VERSION::response& res, epee::json_rpc::error& er, const connection_context *ctx)
{
res.version = WALLET_RPC_VERSION;