From 6845fcd93ac237fe9959d1ddfc4baf6dfa77e94c Mon Sep 17 00:00:00 2001 From: Duke Date: Fri, 13 Sep 2024 04:22:28 -0400 Subject: [PATCH] This rpc can only be used on non z2z chains --- src/wallet/rpcwallet.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index ec99d7516..46a059892 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -629,7 +629,7 @@ UniValue kvupdate(const UniValue& params, bool fHelp, const CPubKey& mypk) if (fHelp || params.size() < 3 ) throw runtime_error( "kvupdate key \"value\" days passphrase\n" - "\nStore a key value. This feature is only available for asset chains.\n" + "\nStore a key value. This feature is only available for non-z2z chains.\n" "\nArguments:\n" "1. key (string, required) key\n" "2. \"value\" (string, required) value\n" @@ -654,8 +654,11 @@ UniValue kvupdate(const UniValue& params, bool fHelp, const CPubKey& mypk) ); if (!EnsureWalletIsAvailable(fHelp)) return 0; - if ( SMART_CHAIN_SYMBOL[0] == 0 ) - return(0); + + if (ASSETCHAINS_PRIVATE) { + throw JSONRPCError(RPC_TYPE_ERROR, "This RPC is only available on non z2z chains"); + } + haveprivkey = 0; memset(&sig,0,sizeof(sig)); memset(&privkey,0,sizeof(privkey));