mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-17 13:07:54 +02:00
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:
commit
c29771437e
1 changed files with 8 additions and 0 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue