build: add ENABLE_WALLET guards to rpc/rpcassets.cpp#446
Open
JSanchezFDZ wants to merge 1 commit into
Open
Conversation
PR Raptor3um#436 added three new RPC handlers that unconditionally reference wallet-only symbols (CWallet, GetWalletForJSONRPCRequest, COutput, CCoinControl, CInputCoin, CoinType): * listassetsbalance (lines 815-869) * listunspentassets (lines 871-1064) * listassets, mine=true (lines 1160-1203) The RPC command table at the bottom of the file already wraps the registrations for listassetsbalance and listunspentassets in #ifdef ENABLE_WALLET, but the function bodies themselves were left unguarded. As a result, configure --disable-wallet builds fail to compile rpc/rpcassets.cpp with dozens of "CWallet was not declared in this scope" errors. Wrap the two wallet-only function bodies in #ifdef ENABLE_WALLET, and in listassets() guard only the mine=true branch (the mine=false branch is intentionally wallet-independent). When wallet support is compiled out and a client passes mine=true, return a clear RPC_METHOD_NOT_FOUND error rather than silently producing wrong data. Verified locally on develop HEAD (989ec2e): ./configure --disable-wallet ... builds raptoreumd successfully (modulo an unrelated NAT-PMP link issue in src/mapport.cpp that predates this change) ./configure --enable-wallet ... still builds, RPCs still work
This was referenced May 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Restore the ability to build with
./configure --disable-walleton currentdevelop.PR #436 (
Bug/createrawtransaction for asset) added three new RPC handlers insrc/rpc/rpcassets.cppthat unconditionally reference wallet-only symbols (CWallet,GetWalletForJSONRPCRequest,COutput,CCoinControl,CInputCoin,CoinType):listassetsbalance(lines 815-869)listunspentassets(lines 871-1064)listassets,mine=truebranch (lines 1160-1203)The RPC command table at the bottom of the file already wraps the registrations for
listassetsbalanceandlistunspentassetsin#ifdef ENABLE_WALLET, but the function bodies themselves were left unguarded. Since the file's includes for wallet headers are gated onENABLE_WALLET(lines 16-20),--disable-walletbuilds fail to compile this TU with dozens of "CWalletwas not declared in this scope" errors.Fix
listassetsbalance,listunspentassets) in#ifdef ENABLE_WALLET/#endif. The matching table entries are already guarded, so when the bodies are absent the function pointers are simply never referenced.listassets, the function is intentionally mixed:mine=falseis wallet-independent (queriespassetsdbonly),mine=trueneeds the wallet. Guard only themine=truebranch, and in the#elsepath throwRPC_METHOD_NOT_FOUNDso a client that requestsmine=trueagainst a no-wallet node sees a clear error instead of silently getting wrong data.Test plan
./configure --disable-bench --without-gui --disable-wallet, thenmake rpc/libraptoreum_server_a-rpcassets.o— compiles cleanly (was broken ondevelop).nmon the resulting.oconfirms zero unresolvedCWallet/GetWalletForJSONRPCRequestsymbols../configure ... --enable-wallet --with-incompatible-bdb, then recompile the same TU — still builds.Note: a separate, pre-existing link-time failure in
src/mapport.cpp(undefined references toreadnatpmpresponseorretry/sendnewportmappingrequestfromlibnatpmp) keeps the no-walletraptoreumdlink from completing on this build host. That's an unrelated NAT-PMP library-ordering issue and not in scope here.Why this matters
--disable-wallet(e.g. for testing headless/light-node configurations) are currently broken ondevelop.--enable-walletand--disable-walletpaths to work.Related: #443 (EVM integration, runs into this same restriction during test-suite verification), #444 (the
amount_testsoverflow fix that lets the test suite report honest pass/fail counts), #445 (broaderCFeeRatehardening tracking).