diff --git a/src/rpc/rpcevo.cpp b/src/rpc/rpcevo.cpp index b8c048cf4e..b3b9a25256 100644 --- a/src/rpc/rpcevo.cpp +++ b/src/rpc/rpcevo.cpp @@ -952,14 +952,18 @@ UniValue BuildDMNListEntry(CWallet* pwallet, const CDeterministicMNCPtr& dmn, bo ownsCollateral = CheckWalletOwnsScript(pwallet, collateralTx->vout[dmn->collateralOutpoint.n].scriptPubKey); } - UniValue walletObj(UniValue::VOBJ); - walletObj.push_back(Pair("hasOwnerKey", hasOwnerKey)); - walletObj.push_back(Pair("hasOperatorKey", hasOperatorKey)); - walletObj.push_back(Pair("hasVotingKey", hasVotingKey)); - walletObj.push_back(Pair("ownsCollateral", ownsCollateral)); - walletObj.push_back(Pair("ownsPayeeScript", CheckWalletOwnsScript(pwallet, dmn->pdmnState->scriptPayout))); - walletObj.push_back(Pair("ownsOperatorRewardScript", CheckWalletOwnsScript(pwallet, dmn->pdmnState->scriptOperatorPayout))); - o.push_back(Pair("wallet", walletObj)); +#ifdef ENABLE_WALLET + if (pwallet) { + UniValue walletObj(UniValue::VOBJ); + walletObj.push_back(Pair("hasOwnerKey", hasOwnerKey)); + walletObj.push_back(Pair("hasOperatorKey", hasOperatorKey)); + walletObj.push_back(Pair("hasVotingKey", hasVotingKey)); + walletObj.push_back(Pair("ownsCollateral", ownsCollateral)); + walletObj.push_back(Pair("ownsPayeeScript", CheckWalletOwnsScript(pwallet, dmn->pdmnState->scriptPayout))); + walletObj.push_back(Pair("ownsOperatorRewardScript", CheckWalletOwnsScript(pwallet, dmn->pdmnState->scriptOperatorPayout))); + o.push_back(Pair("wallet", walletObj)); + } +#endif auto metaInfo = mmetaman.GetMetaInfo(dmn->proTxHash); o.push_back(Pair("metaInfo", metaInfo->ToJson()));