Test
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
#define CHANNELS_MAXPAYMENTS 1000
|
||||
|
||||
bool ChannelsValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &tx);
|
||||
std::string ChannelOpen(uint64_t txfee,CPubKey destpub,int32_t numpayments,int32_t payment);
|
||||
std::string ChannelOpen(uint64_t txfee,CPubKey destpub,int32_t numpayments,int64_t payment);
|
||||
|
||||
// CCcustom
|
||||
UniValue ChannelsInfo();
|
||||
|
||||
@@ -172,12 +172,12 @@ int64_t AddChannelsInputs(struct CCcontract_info *cp,CMutableTransaction &mtx,CP
|
||||
return(totalinputs);
|
||||
}
|
||||
|
||||
std::string ChannelOpen(uint64_t txfee,CPubKey destpub,int32_t numpayments,int32_t payment)
|
||||
std::string ChannelOpen(uint64_t txfee,CPubKey destpub,int32_t numpayments,int64_t payment)
|
||||
{
|
||||
CMutableTransaction mtx; uint8_t hash[32],hashdest[32]; uint64_t funds; int32_t i; uint256 hashchain,entropy,hentropy; CPubKey mypk; CScript opret; struct CCcontract_info *cp,C;
|
||||
if ( numpayments <= 0 || payment <= 0 || numpayments > CHANNELS_MAXPAYMENTS )
|
||||
{
|
||||
CCerror = strprintf("invalid ChannelsFund param numpayments.%d max.%d payment.%d\n",numpayments,CHANNELS_MAXPAYMENTS,payment);
|
||||
CCerror = strprintf("invalid ChannelsFund param numpayments.%d max.%d payment.%lld\n",numpayments,CHANNELS_MAXPAYMENTS,(long long)payment);
|
||||
fprintf(stderr,"%s\n",CCerror.c_str());
|
||||
return("");
|
||||
}
|
||||
|
||||
@@ -5089,7 +5089,7 @@ UniValue tokenaddress(const UniValue& params, bool fHelp)
|
||||
|
||||
UniValue channelsopen(const UniValue& params, bool fHelp)
|
||||
{
|
||||
UniValue result(UniValue::VOBJ); char destaddr[64]; int32_t numpayments,payment; std::vector<unsigned char> destpub; struct CCcontract_info *cp,C; std::string hex;
|
||||
UniValue result(UniValue::VOBJ); char destaddr[64]; int32_t numpayments; int64_t payment; std::vector<unsigned char> destpub; struct CCcontract_info *cp,C; std::string hex;
|
||||
cp = CCinit(&C,EVAL_CHANNELS);
|
||||
if ( fHelp || params.size() != 3 )
|
||||
throw runtime_error("channelsopen destpubkey numpayments payment\n");
|
||||
@@ -5098,7 +5098,7 @@ UniValue channelsopen(const UniValue& params, bool fHelp)
|
||||
LOCK(cs_main);
|
||||
destpub = ParseHex(params[0].get_str().c_str());
|
||||
numpayments = atoi(params[1].get_str().c_str());
|
||||
payment = atoi(params[2].get_str().c_str());
|
||||
payment = atol(params[2].get_str().c_str());
|
||||
hex = ChannelOpen(0,pubkey2pk(destpub),numpayments,payment);
|
||||
if ( hex.size() > 0 )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user