From fd73990d42b3e68e0709028de307944c98842507 Mon Sep 17 00:00:00 2001 From: ericM80 <114583705+ericM80@users.noreply.github.com> Date: Sun, 25 Aug 2024 13:48:39 -0400 Subject: [PATCH] Fix compile with -disable-wallet (#398) * fix bug in rpcevo.cpp if statement starting with else when not ENABLE_WALLET * Update rpcassets.cpp --- src/rpc/rpcassets.cpp | 10 +++++++--- src/rpc/rpcevo.cpp | 5 +++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/rpc/rpcassets.cpp b/src/rpc/rpcassets.cpp index 9741096d4..2dc6eff22 100644 --- a/src/rpc/rpcassets.cpp +++ b/src/rpc/rpcassets.cpp @@ -48,7 +48,7 @@ static std::string GetDistributionType(int t) { } return "invalid"; } - +#ifdef ENABLE_WALLET UniValue createasset(const JSONRPCRequest &request) { if (request.fHelp || !Updates().IsAssetsActive(::ChainActive().Tip()) || request.params.size() < 1 || @@ -732,7 +732,7 @@ UniValue sendasset(const JSONRPCRequest &request) { result.pushKV("txid", wtx->GetHash().GetHex()); return result; } - +#endif//ENABLE_WALLET UniValue getassetdetailsbyname(const JSONRPCRequest &request) { if (request.fHelp || !Updates().IsAssetsActive(::ChainActive().Tip()) || request.params.size() < 1 || @@ -1287,14 +1287,18 @@ UniValue listassetbalancesbyaddress(const JSONRPCRequest& request) static const CRPCCommand commands[] = { // category name actor (function) // --------------------- ------------------------ ----------------------- +#ifdef ENABLE_WALLET {"assets", "createasset", &createasset, {"asset"}}, {"assets", "updateasset", &updateasset, {"asset"}}, {"assets", "mintasset", &mintasset, {"assetId"}}, {"assets", "sendasset", &sendasset, {"assetId", "amount", "address", "change_address", "asset_change_address"}}, +#endif //ENABLE_WALLET {"assets", "getassetdetailsbyname", &getassetdetailsbyname, {"assetname"}}, {"assets", "getassetdetailsbyid", &getassetdetailsbyid, {"assetid"}}, +#ifdef ENABLE_WALLET {"assets", "listassetsbalance", &listassetsbalance, {}}, {"assets", "listunspentassets", &listunspentassets, {"minconf", "maxconf", "addresses", "include_unsafe", "query_options"}}, +#endif //ENABLE_WALLET {"assets", "listassets", &listassets, {"verbose", "count", "start"}}, {"assets", "listaddressesbyasset", &listaddressesbyasset, {"asset_name", "onlytotal", "count", "start"}}, {"assets", "listassetbalancesbyaddress", &listassetbalancesbyaddress, {"address", "onlytotal", "count", "start"} }, @@ -1304,4 +1308,4 @@ void RegisterAssetsRPCCommands(CRPCTable &tableRPC) { for (unsigned int vcidx = 0; vcidx < ARRAYLEN(commands); vcidx++) { tableRPC.appendCommand(commands[vcidx].name, &commands[vcidx]); } -} \ No newline at end of file +} diff --git a/src/rpc/rpcevo.cpp b/src/rpc/rpcevo.cpp index 4a39dc268..6f613f648 100644 --- a/src/rpc/rpcevo.cpp +++ b/src/rpc/rpcevo.cpp @@ -1554,8 +1554,9 @@ UniValue protx(const JSONRPCRequest &request) { } else if(command == "protxquick_setup") { return protx_quick_setup(new_request); } -#endif - else if (command == "protxlist") { + else +#endif //ENABLE_WALLET + if (command == "protxlist") { return protx_list(new_request); } else if (command == "protxinfo") { return protx_info(new_request);