fix opreturn_burn merge conflict

This commit is contained in:
Alrighttt
2019-07-18 16:33:17 +02:00
58 changed files with 1426 additions and 643 deletions

View File

@@ -5544,7 +5544,7 @@ UniValue channelsaddress(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 1 )
throw runtime_error("channelsaddress pubkey\n");
if ( ensure_CCrequirements(0) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
pubkey = ParseHex(params[0].get_str().c_str());
return(CCaddress(cp,(char *)"Channels",pubkey));
}
@@ -5555,7 +5555,7 @@ UniValue cclibaddress(const UniValue& params, bool fHelp)
if ( fHelp || params.size() > 2 )
throw runtime_error("cclibaddress [evalcode] [pubkey]\n");
if ( ensure_CCrequirements(0) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
if ( params.size() >= 1 )
{
evalcode = atoi(params[0].get_str().c_str());
@@ -5576,7 +5576,7 @@ UniValue cclibinfo(const UniValue& params, bool fHelp)
if ( fHelp || params.size() > 0 )
throw runtime_error("cclibinfo\n");
if ( ensure_CCrequirements(0) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
cp = CCinit(&C,evalcode);
return(CClib_info(cp));
}
@@ -5591,7 +5591,7 @@ UniValue cclib(const UniValue& params, bool fHelp)
if ( ASSETCHAINS_CCLIB.size() == 0 )
throw runtime_error("no -ac_cclib= specified\n");
if ( ensure_CCrequirements(0) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
method = (char *)params[0].get_str().c_str();
@@ -5624,7 +5624,7 @@ UniValue payments_release(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 1 )
throw runtime_error("paymentsrelease \"[%22createtxid%22,amount,(skipminimum)]\"\n");
if ( ensure_CCrequirements(EVAL_PAYMENTS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
cp = CCinit(&C,EVAL_PAYMENTS);
@@ -5637,7 +5637,7 @@ UniValue payments_fund(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 1 )
throw runtime_error("paymentsfund \"[%22createtxid%22,amount(,useopret)]\"\n");
if ( ensure_CCrequirements(EVAL_PAYMENTS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
cp = CCinit(&C,EVAL_PAYMENTS);
@@ -5650,7 +5650,7 @@ UniValue payments_merge(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 1 )
throw runtime_error("paymentsmerge \"[%22createtxid%22]\"\n");
if ( ensure_CCrequirements(EVAL_PAYMENTS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
cp = CCinit(&C,EVAL_PAYMENTS);
@@ -5663,7 +5663,7 @@ UniValue payments_txidopret(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 1 )
throw runtime_error("paymentstxidopret \"[allocation,%22scriptPubKey%22(,%22destopret%22)]\"\n");
if ( ensure_CCrequirements(EVAL_PAYMENTS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
cp = CCinit(&C,EVAL_PAYMENTS);
@@ -5676,7 +5676,7 @@ UniValue payments_create(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 1 )
throw runtime_error("paymentscreate \"[lockedblocks,minamount,%22paytxid0%22,...,%22paytxidN%22]\"\n");
if ( ensure_CCrequirements(EVAL_PAYMENTS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
cp = CCinit(&C,EVAL_PAYMENTS);
@@ -5689,7 +5689,7 @@ UniValue payments_airdrop(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 1 )
throw runtime_error("paymentsairdrop \"[lockedblocks,minamount,mintoaddress,top,bottom,fixedFlag,%22excludeAddress%22,...,%22excludeAddressN%22]\"\n");
if ( ensure_CCrequirements(EVAL_PAYMENTS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
cp = CCinit(&C,EVAL_PAYMENTS);
@@ -5702,7 +5702,7 @@ UniValue payments_airdroptokens(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 1 )
throw runtime_error("payments_airdroptokens \"[%22tokenid%22,lockedblocks,minamount,mintoaddress,top,bottom,fixedFlag,%22excludePubKey%22,...,%22excludePubKeyN%22]\"\n");
if ( ensure_CCrequirements(EVAL_PAYMENTS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
cp = CCinit(&C,EVAL_PAYMENTS);
@@ -5715,7 +5715,7 @@ UniValue payments_info(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 1 )
throw runtime_error("paymentsinfo \"[%22createtxid%22]\"\n");
if ( ensure_CCrequirements(EVAL_PAYMENTS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
cp = CCinit(&C,EVAL_PAYMENTS);
@@ -5728,7 +5728,7 @@ UniValue payments_list(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 0 )
throw runtime_error("paymentslist\n");
if ( ensure_CCrequirements(EVAL_PAYMENTS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
cp = CCinit(&C,EVAL_PAYMENTS);
@@ -5742,7 +5742,7 @@ UniValue oraclesaddress(const UniValue& params, bool fHelp)
if ( fHelp || params.size() > 1 )
throw runtime_error("oraclesaddress [pubkey]\n");
if ( ensure_CCrequirements(0) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
if ( params.size() == 1 )
pubkey = ParseHex(params[0].get_str().c_str());
return(CCaddress(cp,(char *)"Oracles",pubkey));
@@ -5756,7 +5756,7 @@ UniValue pricesaddress(const UniValue& params, bool fHelp)
if ( fHelp || params.size() > 1 )
throw runtime_error("pricesaddress [pubkey]\n");
if ( ensure_CCrequirements(0) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
if ( params.size() == 1 )
pubkey = ParseHex(params[0].get_str().c_str());
result = CCaddress(cp,(char *)"Prices",pubkey);
@@ -5778,7 +5778,7 @@ UniValue pegsaddress(const UniValue& params, bool fHelp)
if ( fHelp || params.size() > 1 )
throw runtime_error("pegssaddress [pubkey]\n");
if ( ensure_CCrequirements(0) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
if ( params.size() == 1 )
pubkey = ParseHex(params[0].get_str().c_str());
return(CCaddress(cp,(char *)"Pegs",pubkey));
@@ -5791,7 +5791,7 @@ UniValue marmaraaddress(const UniValue& params, bool fHelp)
if ( fHelp || params.size() > 1 )
throw runtime_error("Marmaraaddress [pubkey]\n");
if ( ensure_CCrequirements(0) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
if ( params.size() == 1 )
pubkey = ParseHex(params[0].get_str().c_str());
return(CCaddress(cp,(char *)"Marmara",pubkey));
@@ -5804,7 +5804,7 @@ UniValue paymentsaddress(const UniValue& params, bool fHelp)
if ( fHelp || params.size() > 1 )
throw runtime_error("paymentsaddress [pubkey]\n");
if ( ensure_CCrequirements(0) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
if ( params.size() == 1 )
pubkey = ParseHex(params[0].get_str().c_str());
return(CCaddress(cp,(char *)"Payments",pubkey));
@@ -5817,7 +5817,7 @@ UniValue gatewaysaddress(const UniValue& params, bool fHelp)
if ( fHelp || params.size() > 1 )
throw runtime_error("gatewaysaddress [pubkey]\n");
if ( ensure_CCrequirements(0) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
if ( params.size() == 1 )
pubkey = ParseHex(params[0].get_str().c_str());
return(CCaddress(cp,(char *)"Gateways",pubkey));
@@ -5830,7 +5830,7 @@ UniValue heiraddress(const UniValue& params, bool fHelp)
if ( fHelp || params.size() > 1 )
throw runtime_error("heiraddress pubkey\n");
if ( ensure_CCrequirements(0) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
pubkey = ParseHex(params[0].get_str().c_str());
return(CCaddress(cp,(char *)"Heir",pubkey));
}
@@ -5842,7 +5842,7 @@ UniValue lottoaddress(const UniValue& params, bool fHelp)
if ( fHelp || params.size() > 1 )
throw runtime_error("lottoaddress [pubkey]\n");
if ( ensure_CCrequirements(0) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
if ( params.size() == 1 )
pubkey = ParseHex(params[0].get_str().c_str());
return(CCaddress(cp,(char *)"Lotto",pubkey));
@@ -5855,7 +5855,7 @@ UniValue FSMaddress(const UniValue& params, bool fHelp)
if ( fHelp || params.size() > 1 )
throw runtime_error("FSMaddress [pubkey]\n");
if ( ensure_CCrequirements(0) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
if ( params.size() == 1 )
pubkey = ParseHex(params[0].get_str().c_str());
return(CCaddress(cp,(char *)"FSM",pubkey));
@@ -5868,7 +5868,7 @@ UniValue auctionaddress(const UniValue& params, bool fHelp)
if ( fHelp || params.size() > 1 )
throw runtime_error("auctionaddress [pubkey]\n");
if ( ensure_CCrequirements(0) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
if ( params.size() == 1 )
pubkey = ParseHex(params[0].get_str().c_str());
return(CCaddress(cp,(char *)"Auction",pubkey));
@@ -5881,7 +5881,7 @@ UniValue diceaddress(const UniValue& params, bool fHelp)
if ( fHelp || params.size() > 1 )
throw runtime_error("diceaddress [pubkey]\n");
if ( ensure_CCrequirements(0) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
if ( params.size() == 1 )
pubkey = ParseHex(params[0].get_str().c_str());
return(CCaddress(cp,(char *)"Dice",pubkey));
@@ -5909,7 +5909,7 @@ UniValue rewardsaddress(const UniValue& params, bool fHelp)
if ( fHelp || params.size() > 1 )
throw runtime_error("rewardsaddress [pubkey]\n");
if ( ensure_CCrequirements(0) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
if ( params.size() == 1 )
pubkey = ParseHex(params[0].get_str().c_str());
return(CCaddress(cp,(char *)"Rewards",pubkey));
@@ -5922,7 +5922,7 @@ UniValue assetsaddress(const UniValue& params, bool fHelp)
if (fHelp || params.size() > 1)
throw runtime_error("assetsaddress [pubkey]\n");
if (ensure_CCrequirements(0) < 0)
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
if (params.size() == 1)
pubkey = ParseHex(params[0].get_str().c_str());
return(CCaddress(cp, (char *)"Assets", pubkey));
@@ -5935,7 +5935,7 @@ UniValue tokenaddress(const UniValue& params, bool fHelp)
if ( fHelp || params.size() > 1 )
throw runtime_error("tokenaddress [pubkey]\n");
if ( ensure_CCrequirements(0) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
if ( params.size() == 1 )
pubkey = ParseHex(params[0].get_str().c_str());
return(CCaddress(cp,(char *)"Tokens", pubkey));
@@ -5948,7 +5948,7 @@ UniValue importgatewayaddress(const UniValue& params, bool fHelp)
if ( fHelp || params.size() > 1 )
throw runtime_error("importgatewayddress [pubkey]\n");
if ( ensure_CCrequirements(0) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
if ( params.size() == 1 )
pubkey = ParseHex(params[0].get_str().c_str());
return(CCaddress(cp,(char *)"ImportGateway", pubkey));
@@ -5964,7 +5964,7 @@ UniValue marmara_poolpayout(const UniValue& params, bool fHelp)
throw runtime_error("marmarapoolpayout perc firstheight \"[[\\\"pubkey\\\":shares], ...]\"\n");
}
if ( ensure_CCrequirements(EVAL_MARMARA) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
perc = atof(params[0].get_str().c_str()) / 100.;
@@ -5984,7 +5984,7 @@ UniValue marmara_receive(const UniValue& params, bool fHelp)
throw runtime_error("marmarareceive senderpk amount currency matures batontxid\n");
}
if ( ensure_CCrequirements(EVAL_MARMARA) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
memset(&batontxid,0,sizeof(batontxid));
@@ -6015,7 +6015,7 @@ UniValue marmara_issue(const UniValue& params, bool fHelp)
throw runtime_error("marmaraissue receiverpk amount currency matures approvaltxid\n");
}
if ( ensure_CCrequirements(EVAL_MARMARA) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
receiverpub = ParseHex(params[0].get_str().c_str());
@@ -6040,7 +6040,7 @@ UniValue marmara_transfer(const UniValue& params, bool fHelp)
throw runtime_error("marmaratransfer receiverpk amount currency matures approvaltxid\n");
}
if ( ensure_CCrequirements(EVAL_MARMARA) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
receiverpub = ParseHex(params[0].get_str().c_str());
if (receiverpub.size()!= 33)
{
@@ -6066,7 +6066,7 @@ UniValue marmara_info(const UniValue& params, bool fHelp)
throw runtime_error("marmarainfo firstheight lastheight minamount maxamount [currency issuerpk]\n");
}
if ( ensure_CCrequirements(EVAL_MARMARA) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
firstheight = atol(params[0].get_str().c_str());
@@ -6098,7 +6098,7 @@ UniValue marmara_creditloop(const UniValue& params, bool fHelp)
throw runtime_error("marmaracreditloop txid\n");
}
if ( ensure_CCrequirements(EVAL_MARMARA) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
txid = Parseuint256((char *)params[0].get_str().c_str());
@@ -6116,7 +6116,7 @@ UniValue marmara_settlement(const UniValue& params, bool fHelp)
throw runtime_error("marmarasettlement batontxid\n");
}
if ( ensure_CCrequirements(EVAL_MARMARA) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
batontxid = Parseuint256((char *)params[0].get_str().c_str());
@@ -6145,7 +6145,7 @@ UniValue channelslist(const UniValue& params, bool fHelp)
if ( fHelp || params.size() > 0 )
throw runtime_error("channelsinfo\n");
if ( ensure_CCrequirements(EVAL_CHANNELS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
return(ChannelsList());
@@ -6157,7 +6157,7 @@ UniValue channelsinfo(const UniValue& params, bool fHelp)
if ( fHelp || params.size() > 1 )
throw runtime_error("channelsinfo [opentxid]\n");
if ( ensure_CCrequirements(EVAL_CHANNELS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
opentxid=zeroid;
@@ -6175,7 +6175,7 @@ UniValue channelsopen(const UniValue& params, bool fHelp)
if ( fHelp || params.size() < 3 || params.size() > 4)
throw runtime_error("channelsopen destpubkey numpayments payment\n");
if ( ensure_CCrequirements(EVAL_CHANNELS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
destpub = ParseHex(params[0].get_str().c_str());
@@ -6217,7 +6217,7 @@ UniValue channelspayment(const UniValue& params, bool fHelp)
if ( fHelp || params.size() < 2 || params.size() >3 )
throw runtime_error("channelspayment opentxid amount [secret]\n");
if ( ensure_CCrequirements(EVAL_CHANNELS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
opentxid = Parseuint256((char *)params[0].get_str().c_str());
@@ -6248,7 +6248,7 @@ UniValue channelsclose(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 1 )
throw runtime_error("channelsclose opentxid\n");
if ( ensure_CCrequirements(EVAL_CHANNELS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
opentxid = Parseuint256((char *)params[0].get_str().c_str());
@@ -6269,7 +6269,7 @@ UniValue channelsrefund(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 2 )
throw runtime_error("channelsrefund opentxid closetxid\n");
if ( ensure_CCrequirements(EVAL_CHANNELS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
opentxid = Parseuint256((char *)params[0].get_str().c_str());
@@ -6290,7 +6290,7 @@ UniValue rewardscreatefunding(const UniValue& params, bool fHelp)
if ( fHelp || params.size() > 6 || params.size() < 2 )
throw runtime_error("rewardscreatefunding name amount APR mindays maxdays mindeposit\n");
if ( ensure_CCrequirements(EVAL_REWARDS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
// default to OOT params
@@ -6359,7 +6359,7 @@ UniValue rewardslock(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 3 )
throw runtime_error("rewardslock name fundingtxid amount\n");
if ( ensure_CCrequirements(EVAL_REWARDS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
name = (char *)params[0].get_str().c_str();
@@ -6389,7 +6389,7 @@ UniValue rewardsaddfunding(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 3 )
throw runtime_error("rewardsaddfunding name fundingtxid amount\n");
if ( ensure_CCrequirements(EVAL_REWARDS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
name = (char *)params[0].get_str().c_str();
@@ -6424,7 +6424,7 @@ UniValue rewardsunlock(const UniValue& params, bool fHelp)
if ( fHelp || params.size() > 3 || params.size() < 2 )
throw runtime_error("rewardsunlock name fundingtxid [txid]\n");
if ( ensure_CCrequirements(EVAL_REWARDS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
name = (char *)params[0].get_str().c_str();
@@ -6452,7 +6452,7 @@ UniValue rewardslist(const UniValue& params, bool fHelp)
if ( fHelp || params.size() > 0 )
throw runtime_error("rewardslist\n");
if ( ensure_CCrequirements(EVAL_REWARDS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
return(RewardsList());
@@ -6464,7 +6464,7 @@ UniValue rewardsinfo(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 1 )
throw runtime_error("rewardsinfo fundingtxid\n");
if ( ensure_CCrequirements(EVAL_REWARDS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
fundingtxid = Parseuint256((char *)params[0].get_str().c_str());
@@ -6476,7 +6476,7 @@ UniValue gatewayslist(const UniValue& params, bool fHelp)
if ( fHelp || params.size() > 0 )
throw runtime_error("gatewayslist\n");
if ( ensure_CCrequirements(EVAL_GATEWAYS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
return(GatewaysList());
@@ -6489,7 +6489,7 @@ UniValue gatewaysexternaladdress(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 2)
throw runtime_error("gatewaysexternaladdress bindtxid pubkey\n");
if ( ensure_CCrequirements(EVAL_GATEWAYS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
bindtxid = Parseuint256((char *)params[0].get_str().c_str());
@@ -6504,7 +6504,7 @@ UniValue gatewaysdumpprivkey(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 2)
throw runtime_error("gatewaysdumpprivkey bindtxid address\n");
if ( ensure_CCrequirements(EVAL_GATEWAYS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
LOCK2(cs_main, pwalletMain->cs_wallet);
bindtxid = Parseuint256((char *)params[0].get_str().c_str());
std::string strAddress = params[1].get_str();
@@ -6529,7 +6529,7 @@ UniValue gatewaysinfo(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 1 )
throw runtime_error("gatewaysinfo bindtxid\n");
if ( ensure_CCrequirements(EVAL_GATEWAYS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
txid = Parseuint256((char *)params[0].get_str().c_str());
@@ -6544,7 +6544,7 @@ UniValue gatewaysbind(const UniValue& params, bool fHelp)
if ( fHelp || params.size() < 10 )
throw runtime_error("gatewaysbind tokenid oracletxid coin tokensupply M N pubkey(s) pubtype p2shtype wiftype [taddr]\n");
if ( ensure_CCrequirements(EVAL_GATEWAYS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
tokenid = Parseuint256((char *)params[0].get_str().c_str());
@@ -6584,7 +6584,7 @@ UniValue gatewaysdeposit(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 9 )
throw runtime_error("gatewaysdeposit bindtxid height coin cointxid claimvout deposithex proof destpub amount\n");
if ( ensure_CCrequirements(EVAL_GATEWAYS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
bindtxid = Parseuint256((char *)params[0].get_str().c_str());
@@ -6617,7 +6617,7 @@ UniValue gatewaysclaim(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 5 )
throw runtime_error("gatewaysclaim bindtxid coin deposittxid destpub amount\n");
if ( ensure_CCrequirements(EVAL_GATEWAYS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
bindtxid = Parseuint256((char *)params[0].get_str().c_str());
@@ -6643,7 +6643,7 @@ UniValue gatewayswithdraw(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 4 )
throw runtime_error("gatewayswithdraw bindtxid coin withdrawpub amount\n");
if ( ensure_CCrequirements(EVAL_GATEWAYS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
bindtxid = Parseuint256((char *)params[0].get_str().c_str());
@@ -6668,7 +6668,7 @@ UniValue gatewayspartialsign(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 3 )
throw runtime_error("gatewayspartialsign txidaddr refcoin hex\n");
if ( ensure_CCrequirements(EVAL_GATEWAYS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
txid = Parseuint256((char *)params[0].get_str().c_str());
@@ -6690,7 +6690,7 @@ UniValue gatewayscompletesigning(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 3 )
throw runtime_error("gatewayscompletesigning withdrawtxid coin hex\n");
if ( ensure_CCrequirements(EVAL_GATEWAYS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
withdrawtxid = Parseuint256((char *)params[0].get_str().c_str());
@@ -6712,7 +6712,7 @@ UniValue gatewaysmarkdone(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 2 )
throw runtime_error("gatewaysmarkdone completesigningtx coin\n");
if ( ensure_CCrequirements(EVAL_GATEWAYS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
completetxid = Parseuint256((char *)params[0].get_str().c_str());
@@ -6733,7 +6733,7 @@ UniValue gatewayspendingdeposits(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 2 )
throw runtime_error("gatewayspendingdeposits bindtxid coin\n");
if ( ensure_CCrequirements(EVAL_GATEWAYS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
bindtxid = Parseuint256((char *)params[0].get_str().c_str());
@@ -6747,7 +6747,7 @@ UniValue gatewayspendingwithdraws(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 2 )
throw runtime_error("gatewayspendingwithdraws bindtxid coin\n");
if ( ensure_CCrequirements(EVAL_GATEWAYS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
bindtxid = Parseuint256((char *)params[0].get_str().c_str());
@@ -6761,7 +6761,7 @@ UniValue gatewaysprocessed(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 2 )
throw runtime_error("gatewaysprocessed bindtxid coin\n");
if ( ensure_CCrequirements(EVAL_GATEWAYS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
bindtxid = Parseuint256((char *)params[0].get_str().c_str());
@@ -6774,7 +6774,7 @@ UniValue oracleslist(const UniValue& params, bool fHelp)
if ( fHelp || params.size() > 0 )
throw runtime_error("oracleslist\n");
if ( ensure_CCrequirements(EVAL_ORACLES) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
return(OraclesList());
@@ -6786,7 +6786,7 @@ UniValue oraclesinfo(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 1 )
throw runtime_error("oraclesinfo oracletxid\n");
if ( ensure_CCrequirements(EVAL_ORACLES) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
txid = Parseuint256((char *)params[0].get_str().c_str());
@@ -6799,7 +6799,7 @@ UniValue oraclesfund(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 1 )
throw runtime_error("oraclesfund oracletxid\n");
if ( ensure_CCrequirements(EVAL_ORACLES) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
txid = Parseuint256((char *)params[0].get_str().c_str());
@@ -6819,7 +6819,7 @@ UniValue oraclesregister(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 2 )
throw runtime_error("oraclesregister oracletxid datafee\n");
if ( ensure_CCrequirements(EVAL_ORACLES) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
txid = Parseuint256((char *)params[0].get_str().c_str());
@@ -6841,7 +6841,7 @@ UniValue oraclessubscribe(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 3 )
throw runtime_error("oraclessubscribe oracletxid publisher amount\n");
if ( ensure_CCrequirements(EVAL_ORACLES) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
txid = Parseuint256((char *)params[0].get_str().c_str());
@@ -6863,7 +6863,7 @@ UniValue oraclessample(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 2 )
throw runtime_error("oraclessample oracletxid txid\n");
if ( ensure_CCrequirements(EVAL_ORACLES) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
oracletxid = Parseuint256((char *)params[0].get_str().c_str());
@@ -6877,7 +6877,7 @@ UniValue oraclessamples(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 3 )
throw runtime_error("oraclessamples oracletxid batonaddress num\n");
if ( ensure_CCrequirements(EVAL_ORACLES) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
txid = Parseuint256((char *)params[0].get_str().c_str());
@@ -6892,7 +6892,7 @@ UniValue oraclesdata(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 2 )
throw runtime_error("oraclesdata oracletxid hexstr\n");
if ( ensure_CCrequirements(EVAL_ORACLES) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
txid = Parseuint256((char *)params[0].get_str().c_str());
@@ -6913,7 +6913,7 @@ UniValue oraclescreate(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 3 )
throw runtime_error("oraclescreate name description format\n");
if ( ensure_CCrequirements(EVAL_ORACLES) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
name = params[0].get_str();
@@ -6950,7 +6950,7 @@ UniValue FSMcreate(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 2 )
throw runtime_error("FSMcreate name states\n");
if ( ensure_CCrequirements(EVAL_FSM) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
name = params[0].get_str();
@@ -6970,7 +6970,7 @@ UniValue FSMlist(const UniValue& params, bool fHelp)
if ( fHelp || params.size() > 0 )
throw runtime_error("FSMlist\n");
if ( ensure_CCrequirements(EVAL_FSM) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
return(FSMList());
}
@@ -6980,7 +6980,7 @@ UniValue FSMinfo(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 1 )
throw runtime_error("FSMinfo fundingtxid\n");
if ( ensure_CCrequirements(EVAL_FSM) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
FSMtxid = Parseuint256((char *)params[0].get_str().c_str());
return(FSMInfo(FSMtxid));
}
@@ -6991,7 +6991,7 @@ UniValue faucetinfo(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 0 )
throw runtime_error("faucetinfo\n");
if ( ensure_CCrequirements(EVAL_FAUCET) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
return(FaucetInfo());
}
@@ -7000,11 +7000,19 @@ UniValue faucetfund(const UniValue& params, bool fHelp)
UniValue result(UniValue::VOBJ); int64_t funds; std::string hex;
if ( fHelp || params.size() > 1 )
throw runtime_error("faucetfund amount\n");
funds = atof(params[0].get_str().c_str()) * COIN + 0.00000000499999;
if ( (0) && KOMODO_NSPV != 0 )
{
char coinaddr[64]; struct CCcontract_info *cp,C; CTxOut v;
cp = CCinit(&C,EVAL_FAUCET);
v = MakeCC1vout(EVAL_FAUCET,funds,GetUnspendable(cp,0));
Getscriptaddress(coinaddr,CScript() << ParseHex(HexStr(pubkey2pk(Mypubkey()))) << OP_CHECKSIG);
return(NSPV_spend(coinaddr,(char *)HexStr(v.scriptPubKey.begin()+1,v.scriptPubKey.end()-1).c_str(),funds));
}
if ( ensure_CCrequirements(EVAL_FAUCET) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
funds = atof(params[0].get_str().c_str()) * COIN + 0.00000000499999;
if (funds > 0) {
hex = FaucetFund(0,(uint64_t) funds);
if ( hex.size() > 0 )
@@ -7022,7 +7030,7 @@ UniValue faucetget(const UniValue& params, bool fHelp)
if ( fHelp || params.size() > 0 )
throw runtime_error("faucetget\n");
if ( ensure_CCrequirements(EVAL_FAUCET) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
hex = FaucetGet(0);
@@ -7051,7 +7059,7 @@ UniValue priceslist(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 0 && params.size() != 1)
throw runtime_error("priceslist [all|open|closed]\n");
if ( ensure_CCrequirements(EVAL_PRICES) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
uint32_t filter = 0;
if (params.size() == 1)
filter = pricesGetParam(params[0]);
@@ -7066,7 +7074,7 @@ UniValue mypriceslist(const UniValue& params, bool fHelp)
if (fHelp || params.size() != 0 && params.size() != 1)
throw runtime_error("mypriceslist [all|open|closed]\n");
if (ensure_CCrequirements(EVAL_PRICES) < 0)
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
uint32_t filter = 0;
if (params.size() == 1)
@@ -7082,7 +7090,7 @@ UniValue pricesinfo(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 1 && params.size() != 2)
throw runtime_error("pricesinfo bettxid [height]\n");
if ( ensure_CCrequirements(EVAL_PRICES) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
bettxid = Parseuint256((char *)params[0].get_str().c_str());
height = 0;
if (params.size() == 2)
@@ -7096,7 +7104,7 @@ UniValue dicefund(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 6 )
throw runtime_error("dicefund name funds minbet maxbet maxodds timeoutblocks\n");
if ( ensure_CCrequirements(EVAL_DICE) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
name = (char *)params[0].get_str().c_str();
@@ -7129,7 +7137,7 @@ UniValue diceaddfunds(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 3 )
throw runtime_error("diceaddfunds name fundingtxid amount\n");
if ( ensure_CCrequirements(EVAL_DICE) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
name = (char *)params[0].get_str().c_str();
@@ -7157,7 +7165,7 @@ UniValue dicebet(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 4 )
throw runtime_error("dicebet name fundingtxid amount odds\n");
if ( ensure_CCrequirements(EVAL_DICE) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
name = (char *)params[0].get_str().c_str();
@@ -7189,7 +7197,7 @@ UniValue dicefinish(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 3 )
throw runtime_error("dicefinish name fundingtxid bettxid\n");
if ( ensure_CCrequirements(EVAL_DICE) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
name = (char *)params[0].get_str().c_str();
@@ -7224,7 +7232,7 @@ UniValue dicestatus(const UniValue& params, bool fHelp)
if ( fHelp || (params.size() != 2 && params.size() != 3) )
throw runtime_error("dicestatus name fundingtxid bettxid\n");
if ( ensure_CCrequirements(EVAL_DICE) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
name = (char *)params[0].get_str().c_str();
@@ -7272,7 +7280,7 @@ UniValue dicelist(const UniValue& params, bool fHelp)
if ( fHelp || params.size() > 0 )
throw runtime_error("dicelist\n");
if ( ensure_CCrequirements(EVAL_DICE) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
return(DiceList());
}
@@ -7282,7 +7290,7 @@ UniValue diceinfo(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 1 )
throw runtime_error("diceinfo fundingtxid\n");
if ( ensure_CCrequirements(EVAL_DICE) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
fundingtxid = Parseuint256((char *)params[0].get_str().c_str());
return(DiceInfo(fundingtxid));
}
@@ -7293,7 +7301,7 @@ UniValue tokenlist(const UniValue& params, bool fHelp)
if ( fHelp || params.size() > 0 )
throw runtime_error("tokenlist\n");
if ( ensure_CCrequirements(EVAL_TOKENS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
return(TokenList());
}
@@ -7303,7 +7311,7 @@ UniValue tokeninfo(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 1 )
throw runtime_error("tokeninfo tokenid\n");
if ( ensure_CCrequirements(EVAL_TOKENS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
tokenid = Parseuint256((char *)params[0].get_str().c_str());
@@ -7316,7 +7324,7 @@ UniValue tokenorders(const UniValue& params, bool fHelp)
if ( fHelp || params.size() > 1 )
throw runtime_error("tokenorders tokenid\n");
if (ensure_CCrequirements(EVAL_ASSETS) < 0 || ensure_CCrequirements(EVAL_TOKENS) < 0)
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
if (params.size() == 1) {
@@ -7338,7 +7346,7 @@ UniValue mytokenorders(const UniValue& params, bool fHelp)
if (fHelp || params.size() > 2)
throw runtime_error("mytokenorders [evalcode]\n");
if (ensure_CCrequirements(EVAL_ASSETS) < 0 || ensure_CCrequirements(EVAL_TOKENS) < 0)
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
@@ -7357,7 +7365,7 @@ UniValue tokenbalance(const UniValue& params, bool fHelp)
if ( fHelp || params.size() > 2 )
throw runtime_error("tokenbalance tokenid [pubkey]\n");
if ( ensure_CCrequirements(EVAL_TOKENS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
LOCK(cs_main);
@@ -7399,7 +7407,7 @@ UniValue tokencreate(const UniValue& params, bool fHelp)
if ( fHelp || params.size() > 4 || params.size() < 2 )
throw runtime_error("tokencreate name supply [description][data]\n");
if ( ensure_CCrequirements(EVAL_TOKENS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
@@ -7459,7 +7467,7 @@ UniValue tokentransfer(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 3)
throw runtime_error("tokentransfer tokenid destpubkey amount\n");
if ( ensure_CCrequirements(EVAL_TOKENS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
@@ -7495,7 +7503,7 @@ UniValue tokenconvert(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 4 )
throw runtime_error("tokenconvert evalcode tokenid pubkey amount\n");
if ( ensure_CCrequirements(EVAL_ASSETS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
evalcode = atoi(params[0].get_str().c_str());
@@ -7536,7 +7544,7 @@ UniValue tokenbid(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 3 )
throw runtime_error("tokenbid numtokens tokenid price\n");
if (ensure_CCrequirements(EVAL_ASSETS) < 0 || ensure_CCrequirements(EVAL_TOKENS) < 0)
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
//numtokens = atoi(params[0].get_str().c_str());
@@ -7578,7 +7586,7 @@ UniValue tokencancelbid(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 2 )
throw runtime_error("tokencancelbid tokenid bidtxid\n");
if (ensure_CCrequirements(EVAL_ASSETS) < 0 || ensure_CCrequirements(EVAL_TOKENS) < 0)
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
tokenid = Parseuint256((char *)params[0].get_str().c_str());
@@ -7603,7 +7611,7 @@ UniValue tokenfillbid(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 3 )
throw runtime_error("tokenfillbid tokenid bidtxid fillamount\n");
if (ensure_CCrequirements(EVAL_ASSETS) < 0 || ensure_CCrequirements(EVAL_TOKENS) < 0)
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
tokenid = Parseuint256((char *)params[0].get_str().c_str());
@@ -7635,7 +7643,7 @@ UniValue tokenask(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 3 )
throw runtime_error("tokenask numtokens tokenid price\n");
if (ensure_CCrequirements(EVAL_ASSETS) < 0 || ensure_CCrequirements(EVAL_TOKENS) < 0)
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
//numtokens = atoi(params[0].get_str().c_str());
@@ -7669,7 +7677,7 @@ UniValue tokenswapask(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 4 )
throw runtime_error("tokenswapask numtokens tokenid otherid price\n");
if ( ensure_CCrequirements(EVAL_ASSETS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
//numtokens = atoi(params[0].get_str().c_str());
@@ -7697,7 +7705,7 @@ UniValue tokencancelask(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 2 )
throw runtime_error("tokencancelask tokenid asktxid\n");
if (ensure_CCrequirements(EVAL_ASSETS) < 0 || ensure_CCrequirements(EVAL_TOKENS) < 0)
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
tokenid = Parseuint256((char *)params[0].get_str().c_str());
@@ -7722,7 +7730,7 @@ UniValue tokenfillask(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 3 )
throw runtime_error("tokenfillask tokenid asktxid fillunits\n");
if (ensure_CCrequirements(EVAL_ASSETS) < 0 || ensure_CCrequirements(EVAL_TOKENS) < 0)
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
tokenid = Parseuint256((char *)params[0].get_str().c_str());
@@ -7762,7 +7770,7 @@ UniValue tokenfillswap(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 4 )
throw runtime_error("tokenfillswap tokenid otherid asktxid fillunits\n");
if ( ensure_CCrequirements(EVAL_ASSETS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
tokenid = Parseuint256((char *)params[0].get_str().c_str());
@@ -7843,7 +7851,7 @@ UniValue heirfund(const UniValue& params, bool fHelp)
if (fHelp || params.size() != 6 && params.size() != 7)
throw runtime_error("heirfund txfee funds heirname heirpubkey inactivitytime memo [tokenid]\n");
if (ensure_CCrequirements(EVAL_HEIR) < 0)
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
@@ -7917,7 +7925,7 @@ UniValue heiradd(const UniValue& params, bool fHelp)
if (fHelp || params.size() != 3)
throw runtime_error("heiradd txfee funds fundingtxid\n");
if (ensure_CCrequirements(EVAL_HEIR) < 0)
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
@@ -7951,7 +7959,7 @@ UniValue heirclaim(const UniValue& params, bool fHelp)
if (fHelp || params.size() != 3)
throw runtime_error("heirclaim txfee funds fundingtxid\n");
if (ensure_CCrequirements(EVAL_HEIR) < 0)
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
@@ -7976,7 +7984,7 @@ UniValue heirinfo(const UniValue& params, bool fHelp)
throw runtime_error("heirinfo fundingtxid\n");
// if ( ensure_CCrequirements(EVAL_HEIR) < 0 )
// throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
// throw runtime_error(CC_REQUIREMENTS_MSG);
fundingtxid = Parseuint256((char*)params[0].get_str().c_str());
return (HeirInfo(fundingtxid));
@@ -7988,7 +7996,7 @@ UniValue heirlist(const UniValue& params, bool fHelp)
throw runtime_error("heirlist\n");
// if ( ensure_CCrequirements(EVAL_HEIR) < 0 )
// throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
// throw runtime_error(CC_REQUIREMENTS_MSG);
return (HeirList());
}
@@ -8001,7 +8009,7 @@ UniValue pegscreate(const UniValue& params, bool fHelp)
if ( fHelp || params.size()<3)
throw runtime_error("pegscreate amount N bindtxid1 [bindtxid2 ...]\n");
if ( ensure_CCrequirements(EVAL_PEGS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
amount = atof((char *)params[0].get_str().c_str()) * COIN + 0.00000000499999;
@@ -8031,7 +8039,7 @@ UniValue pegsfund(const UniValue& params, bool fHelp)
if ( fHelp || params.size()!=3)
throw runtime_error("pegsfund pegstxid tokenid amount\n");
if ( ensure_CCrequirements(EVAL_PEGS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
pegstxid = Parseuint256(params[0].get_str().c_str());
@@ -8054,7 +8062,7 @@ UniValue pegsget(const UniValue& params, bool fHelp)
if ( fHelp || params.size()!=3)
throw runtime_error("pegsget pegstxid tokenid amount\n");
if ( ensure_CCrequirements(EVAL_PEGS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
pegstxid = Parseuint256(params[0].get_str().c_str());
@@ -8077,7 +8085,7 @@ UniValue pegsredeem(const UniValue& params, bool fHelp)
if ( fHelp || params.size()!=2)
throw runtime_error("pegsredem pegstxid tokenid\n");
if ( ensure_CCrequirements(EVAL_PEGS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
pegstxid = Parseuint256(params[0].get_str().c_str());
@@ -8099,7 +8107,7 @@ UniValue pegsliquidate(const UniValue& params, bool fHelp)
if ( fHelp || params.size()!=3)
throw runtime_error("pegsliquidate pegstxid tokenid accounttxid\n");
if ( ensure_CCrequirements(EVAL_PEGS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
pegstxid = Parseuint256(params[0].get_str().c_str());
@@ -8122,7 +8130,7 @@ UniValue pegsexchange(const UniValue& params, bool fHelp)
if ( fHelp || params.size()!=3)
throw runtime_error("pegsliquidate pegstxid tokenid accounttxid\n");
if ( ensure_CCrequirements(EVAL_PEGS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
pegstxid = Parseuint256(params[0].get_str().c_str());
@@ -8145,7 +8153,7 @@ UniValue pegsaccounthistory(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 1 )
throw runtime_error("pegsaccounthistory pegstxid\n");
if ( ensure_CCrequirements(EVAL_GATEWAYS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
pegstxid = Parseuint256((char *)params[0].get_str().c_str());
@@ -8159,7 +8167,7 @@ UniValue pegsaccountinfo(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 1 )
throw runtime_error("pegsaccountinfo pegstxid\n");
if ( ensure_CCrequirements(EVAL_GATEWAYS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
pegstxid = Parseuint256((char *)params[0].get_str().c_str());
@@ -8173,7 +8181,7 @@ UniValue pegsworstaccounts(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 1 )
throw runtime_error("pegsworstaccounts pegstxid\n");
if ( ensure_CCrequirements(EVAL_GATEWAYS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
pegstxid = Parseuint256((char *)params[0].get_str().c_str());
@@ -8187,7 +8195,7 @@ UniValue pegsinfo(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 1 )
throw runtime_error("pegsinfo pegstxid\n");
if ( ensure_CCrequirements(EVAL_GATEWAYS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
throw runtime_error(CC_REQUIREMENTS_MSG);
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
pegstxid = Parseuint256((char *)params[0].get_str().c_str());
@@ -8317,7 +8325,7 @@ UniValue opreturn_burn(const UniValue& params, bool fHelp)
struct CCcontract_info *cp, C; UniValue ret(UniValue::VOBJ);
// this doesnt actually require EVAL_ORACLES and is just used as a dummy for CCFinalizeTx
cp = CCinit(&C, EVAL_ORACLES);
CAmount nAmount = AmountFromValue(params[0]);
vHexStr = ParseHex(params[1].get_str());
if ( vHexStr.size() == 0 )