Merge #625: Disallow issuance calls in bitcoin mode

5de1e3f9d Disallow issuance calls in bitcoin mode (Gregory Sanders)

Pull request description:

  Enough people are running `-regtest` and getting confused as to why they cannot issue assets to make some checks worth it even though we don't intend people to run bitcoin mode at all.

Tree-SHA512: cb595839d01a000b5a48be4ae5c7084a687bb5c252be8f812f56455082ed78e66cb15313ab15934941cd403040ae253d8270faf6e85995d5caa0d1a66ccd3c6c
This commit is contained in:
Steven Roose 2019-06-05 10:39:58 +01:00
commit c29771437e
No known key found for this signature in database
GPG key ID: 2F2A88D7F8D68E87

View file

@ -5977,6 +5977,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=<custom chain name>`");
}
CAmount nAmount = AmountFromValue(request.params[0]);
CAmount nTokens = AmountFromValue(request.params[1]);
if (nAmount == 0 && nTokens == 0) {
@ -6068,6 +6072,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=<custom chain name>`");
}
std::string assetstr = request.params[0].get_str();
CAsset asset = GetAssetFromString(assetstr);