Browse Source

-print

warmup
jl777 5 years ago
parent
commit
93fb6f5f51
  1. 1
      src/cc/CCinclude.h
  2. 14
      src/cc/CCtx.cpp
  3. 23
      src/rpc/crosschain.cpp
  4. 10
      src/rpc/testtransactions.cpp
  5. 236
      src/wallet/rpcwallet.cpp

1
src/cc/CCinclude.h

@ -56,6 +56,7 @@ one other technical note is that komodod has the insight-explorer extensions bui
#define CC_BURNPUBKEY "02deaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddead"
#define CC_MAXVINS 1024
#define CC_REQUIREMENTS_MSG (KOMMODO_NSPV!=0?"to use CC contracts you need to nspv_login first\n":"to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n")
#define SMALLVAL 0.000000000000001
#define SATOSHIDEN ((uint64_t)100000000L)

14
src/cc/CCtx.cpp

@ -280,13 +280,13 @@ std::string FinalizeCCTx(uint64_t CCmask,struct CCcontract_info *cp,CMutableTran
uint256 sighash = SignatureHash(CCPubKey(cond), mtx, i, SIGHASH_ALL, utxovalues[i],consensusBranchId, &txdata);
if ( cc_signTreeSecp256k1Msg32(cond,privkey,sighash.begin()) != 0 )
{
int32_t z;
for (z=0; z<32; z++)
fprintf(stderr,"%02x",((uint8_t *)sighash.begin())[z]);
fprintf(stderr," sighash, ");
for (z=0; z<32; z++)
fprintf(stderr,"%02x",privkey[z]);
fprintf(stderr," signed with privkey\n");
//int32_t z;
//for (z=0; z<32; z++)
// fprintf(stderr,"%02x",((uint8_t *)sighash.begin())[z]);
//fprintf(stderr," sighash, ");
//for (z=0; z<32; z++)
// fprintf(stderr,"%02x",privkey[z]);
//fprintf(stderr," signed with privkey\n");
mtx.vin[i].scriptSig = CCSig(cond);
}
else

23
src/rpc/crosschain.cpp

@ -854,6 +854,7 @@ UniValue importgatewayinfo(const UniValue& params, bool fHelp)
return(ImportGatewayInfo(txid));
}
UniValue importgatewaybind(const UniValue& params, bool fHelp)
{
UniValue result(UniValue::VOBJ);
@ -866,7 +867,7 @@ UniValue importgatewaybind(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 8)
throw runtime_error("use \'importgatewaybind coin orcletxid M N pubkeys pubtype p2shtype wiftype [taddr]\' to bind an import gateway\n");
if ( ensure_CCrequirements(EVAL_IMPORTGATEWAY) < 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);
CCerror = "";
coin = params[0].get_str();
oracletxid = Parseuint256(params[1].get_str().c_str());
@ -919,7 +920,7 @@ UniValue importgatewaydeposit(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 9)
throw runtime_error("use \'importgatewaydeposit bindtxid height coin burntxid nvout rawburntx rawproof destpub amount\' to import deposited coins\n");
if ( ensure_CCrequirements(EVAL_IMPORTGATEWAY) < 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);
CCerror = "";
bindtxid = Parseuint256(params[0].get_str().c_str());
height = atoi(params[1].get_str().c_str());
@ -962,7 +963,7 @@ UniValue importgatewaywithdraw(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 4)
throw runtime_error("use \'importgatewaywithdraw bindtxid coin withdrawpub amount\' to burn imported coins and withdraw them on external chain\n");
if ( ensure_CCrequirements(EVAL_IMPORTGATEWAY) < 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);
CCerror = "";
bindtxid = Parseuint256(params[0].get_str().c_str());
coin = params[1].get_str();
@ -997,7 +998,7 @@ UniValue importgatewaypartialsign(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 3 )
throw runtime_error("importgatewayspartialsign txidaddr refcoin hex\n");
if ( ensure_CCrequirements(EVAL_IMPORTGATEWAY) < 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);
txid = Parseuint256((char *)params[0].get_str().c_str());
coin = params[1].get_str();
parthex = params[2].get_str();
@ -1020,7 +1021,7 @@ UniValue importgatewaycompletesigning(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 3 )
throw runtime_error("importgatewaycompletesigning withdrawtxid coin hex\n");
if ( ensure_CCrequirements(EVAL_IMPORTGATEWAY) < 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);
withdrawtxid = Parseuint256((char *)params[0].get_str().c_str());
coin = params[1].get_str();
txhex = params[2].get_str();
@ -1040,7 +1041,7 @@ UniValue importgatewaymarkdone(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 2 )
throw runtime_error("importgatewaymarkdone completesigningtx coin\n");
if ( ensure_CCrequirements(EVAL_IMPORTGATEWAY) < 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);
completetxid = Parseuint256((char *)params[0].get_str().c_str());
coin = params[1].get_str();
hex = ImportGatewayMarkDone(0,completetxid,coin);
@ -1059,7 +1060,7 @@ UniValue importgatewaypendingdeposits(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 2 )
throw runtime_error("importgatewaypendingdeposits bindtxid coin\n");
if ( ensure_CCrequirements(EVAL_IMPORTGATEWAY) < 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);
bindtxid = Parseuint256((char *)params[0].get_str().c_str());
coin = params[1].get_str();
return(ImportGatewayPendingDeposits(bindtxid,coin));
@ -1071,7 +1072,7 @@ UniValue importgatewaypendingwithdraws(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 2 )
throw runtime_error("importgatewaypendingwithdraws bindtxid coin\n");
if ( ensure_CCrequirements(EVAL_IMPORTGATEWAY) < 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);
bindtxid = Parseuint256((char *)params[0].get_str().c_str());
coin = params[1].get_str();
return(ImportGatewayPendingWithdraws(bindtxid,coin));
@ -1083,7 +1084,7 @@ UniValue importgatewayprocessed(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 2 )
throw runtime_error("importgatewayprocessed bindtxid coin\n");
if ( ensure_CCrequirements(EVAL_IMPORTGATEWAY) < 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);
bindtxid = Parseuint256((char *)params[0].get_str().c_str());
coin = params[1].get_str();
return(ImportGatewayProcessedWithdraws(bindtxid,coin));
@ -1096,7 +1097,7 @@ UniValue importgatewayexternaladdress(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 2)
throw runtime_error("importgatewayexternaladdress bindtxid pubkey\n");
if ( ensure_CCrequirements(EVAL_IMPORTGATEWAY) < 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);
bindtxid = Parseuint256((char *)params[0].get_str().c_str());
pubkey = ParseHex(params[1].get_str().c_str());
return(ImportGatewayExternalAddress(bindtxid,pubkey));
@ -1109,7 +1110,7 @@ UniValue importgatewaydumpprivkey(const UniValue& params, bool fHelp)
if ( fHelp || params.size() != 2)
throw runtime_error("importgatewaydumpprivkey bindtxid address\n");
if ( ensure_CCrequirements(EVAL_IMPORTGATEWAY) < 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);
bindtxid = Parseuint256((char *)params[0].get_str().c_str());
std::string strAddress = params[1].get_str();
CTxDestination dest = DecodeDestination(strAddress);

10
src/rpc/testtransactions.cpp

@ -61,7 +61,7 @@ UniValue test_ac(const UniValue& params, bool fHelp)
if (fHelp || (params.size() != 4))
throw runtime_error("incorrect params\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);
std::vector<unsigned char> pubkey1;
std::vector<unsigned char> pubkey2;
@ -106,7 +106,7 @@ UniValue test_heirmarker(const UniValue& params, bool fHelp)
if (fHelp || (params.size() != 1))
throw runtime_error("incorrect params\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);
uint256 fundingtxid = Parseuint256((char *)params[0].get_str().c_str());
@ -137,7 +137,7 @@ UniValue test_burntx(const UniValue& params, bool fHelp)
if (fHelp || (params.size() != 1))
throw runtime_error("incorrect params\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);
uint256 tokenid = Parseuint256((char *)params[0].get_str().c_str());
@ -230,7 +230,7 @@ UniValue test_pricesmarker(const UniValue& params, bool fHelp)
if (fHelp || (params.size() != 1))
throw runtime_error("incorrect params\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);
uint256 bettxid = Parseuint256((char *)params[0].get_str().c_str());
@ -265,4 +265,4 @@ void RegisterTesttransactionsRPCCommands(CRPCTable &tableRPC)
{
for (unsigned int vcidx = 0; vcidx < ARRAYLEN(commands); vcidx++)
tableRPC.appendCommand(commands[vcidx].name, &commands[vcidx]);
}
}

236
src/wallet/rpcwallet.cpp

@ -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());
}
@ -7010,7 +7010,7 @@ UniValue faucetfund(const UniValue& params, bool fHelp)
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);
if (funds > 0) {
@ -7030,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);
@ -7059,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]);
@ -7074,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)
@ -7090,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)
@ -7104,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();
@ -7137,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();
@ -7165,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();
@ -7197,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();
@ -7232,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();
@ -7280,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());
}
@ -7290,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));
}
@ -7301,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());
}
@ -7311,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());
@ -7324,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) {
@ -7346,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);
@ -7365,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);
@ -7407,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);
@ -7467,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);
@ -7503,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());
@ -7544,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());
@ -7586,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());
@ -7611,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());
@ -7643,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());
@ -7677,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());
@ -7705,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());
@ -7730,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());
@ -7770,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());
@ -7851,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);
@ -7925,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);
@ -7959,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);
@ -7984,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));
@ -7996,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());
}
@ -8009,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;
@ -8039,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());
@ -8062,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());
@ -8085,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());
@ -8107,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());
@ -8130,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());
@ -8153,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());
@ -8167,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());
@ -8181,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());
@ -8195,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());
@ -8304,7 +8304,7 @@ UniValue opreturn_burn(const UniValue& params, bool fHelp)
throw runtime_error("amount to burn, hexstring to send\n");
struct CCcontract_info *cp, C; UniValue ret(UniValue::VOBJ);
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);
cp = CCinit(&C, EVAL_ORACLES);
CAmount nAmount = AmountFromValue(params[0]);

Loading…
Cancel
Save