Merge #646: [0.17 backport] Disallow issuance calls in bitcoin mode

434067a Disallow issuance calls in bitcoin mode (Gregory Sanders)

Pull request description:

  backport of #625 for 0.17

Tree-SHA512: f90fe5ab03554362bd9307d50999061d8ec131886261784e4f44da6af89450743eef474ac23884c3ca3e931c5036980f02b2d7a1f4b8aea860bbb5bb56422bdb
This commit is contained in:
Gregory Sanders 2019-06-06 10:14:56 +02:00
commit 5f6e9e03b4
No known key found for this signature in database
GPG key ID: F3F68E2D86A48FDB

View file

@ -5741,6 +5741,10 @@ UniValue issueasset(const JSONRPCRequest& request)
LOCK2(cs_main, 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) {
@ -5828,6 +5832,10 @@ UniValue reissueasset(const JSONRPCRequest& request)
LOCK2(cs_main, 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);