Skip to content

Commit

Permalink
Fix compile with -disable-wallet (#398)
Browse files Browse the repository at this point in the history
* fix bug in rpcevo.cpp

if statement starting with else when not ENABLE_WALLET

* Update rpcassets.cpp
  • Loading branch information
ericM80 authored Aug 25, 2024
1 parent b9de5be commit fd73990
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
10 changes: 7 additions & 3 deletions src/rpc/rpcassets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 ||
Expand Down Expand Up @@ -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 ||
Expand Down Expand Up @@ -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"} },
Expand All @@ -1304,4 +1308,4 @@ void RegisterAssetsRPCCommands(CRPCTable &tableRPC) {
for (unsigned int vcidx = 0; vcidx < ARRAYLEN(commands); vcidx++) {
tableRPC.appendCommand(commands[vcidx].name, &commands[vcidx]);
}
}
}
5 changes: 3 additions & 2 deletions src/rpc/rpcevo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit fd73990

Please sign in to comment.