|
|
@ -6349,7 +6349,7 @@ UniValue gatewaysbind(const UniValue& params, bool fHelp) |
|
|
|
UniValue result(UniValue::VOBJ); uint256 tokenid,oracletxid; int32_t i; int64_t totalsupply; std::vector<CPubKey> pubkeys; |
|
|
|
uint8_t M,N,p1,p2,p3,p4=0; std::string hex,coin; std::vector<unsigned char> pubkey; |
|
|
|
|
|
|
|
if ( fHelp || params.size() < 9 ) |
|
|
|
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"); |
|
|
@ -6363,10 +6363,10 @@ UniValue gatewaysbind(const UniValue& params, bool fHelp) |
|
|
|
N = atoi((char *)params[5].get_str().c_str()); |
|
|
|
if ( M > N || N == 0 || N > 15 || totalsupply < COIN/100 || tokenid == zeroid ) |
|
|
|
throw runtime_error("illegal M or N > 15 or tokensupply or invalid tokenid\n"); |
|
|
|
if ( params.size() < 6+N+3 ) |
|
|
|
throw runtime_error("not enough parameters for N pubkeys\n"); |
|
|
|
for (i=0; i<N; i++) |
|
|
|
{ |
|
|
|
if ( params.size() < 6+i+1 ) |
|
|
|
throw runtime_error("not enough parameters for N pubkeys\n"); |
|
|
|
{ |
|
|
|
pubkey = ParseHex(params[6+i].get_str().c_str()); |
|
|
|
if (pubkey.size()!= 33) |
|
|
|
throw runtime_error("invalid destination pubkey"); |
|
|
@ -6375,7 +6375,7 @@ UniValue gatewaysbind(const UniValue& params, bool fHelp) |
|
|
|
p1 = atoi((char *)params[6+N].get_str().c_str()); |
|
|
|
p2 = atoi((char *)params[6+N+1].get_str().c_str()); |
|
|
|
p3 = atoi((char *)params[6+N+2].get_str().c_str()); |
|
|
|
if (params.size() == 9+N) p4 = atoi((char *)params[6+N+3].get_str().c_str()); |
|
|
|
if (params.size() == 9+N+1) p4 = atoi((char *)params[9+N].get_str().c_str()); |
|
|
|
hex = GatewaysBind(0,coin,tokenid,totalsupply,oracletxid,M,N,pubkeys,p1,p2,p3,p4); |
|
|
|
RETURN_IF_ERROR(CCerror); |
|
|
|
if ( hex.size() > 0 ) |
|
|
|