From 5de1e3f9d580ea89c62d3a92c9f3127b9e3d4d62 Mon Sep 17 00:00:00 2001 From: Gregory Sanders Date: Mon, 20 May 2019 07:45:42 -0400 Subject: [PATCH] Disallow issuance calls in bitcoin mode --- src/wallet/rpcwallet.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index c72f8db36a..f5bac054db 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -5850,6 +5850,10 @@ UniValue issueasset(const JSONRPCRequest& request) auto locked_chain = pwallet->chain().lock(); LOCK(pwallet->cs_wallet); + if (!g_con_elementsmode) { + throw JSONRPCError(RPC_TYPE_ERROR, "Issuance can only be done on elements-style chains. Note: `-regtest` is Bitcoin's regtest mode, instead try `-chain=`"); + } + CAmount nAmount = AmountFromValue(request.params[0]); CAmount nTokens = AmountFromValue(request.params[1]); if (nAmount == 0 && nTokens == 0) { @@ -5938,6 +5942,10 @@ UniValue reissueasset(const JSONRPCRequest& request) auto locked_chain = pwallet->chain().lock(); LOCK(pwallet->cs_wallet); + if (!g_con_elementsmode) { + throw JSONRPCError(RPC_TYPE_ERROR, "Issuance can only be done on elements-style chains. Note: `-regtest` is Bitcoin's regtest mode, instead try `-chain=`"); + } + std::string assetstr = request.params[0].get_str(); CAsset asset = GetAssetFromString(assetstr);