From 11020cf22c3c95eb5ab879bf4dad870f43f3c1ac Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 28 Aug 2018 03:00:53 -1100 Subject: [PATCH] Test --- src/cc/CCchannels.h | 2 +- src/cc/channels.cpp | 4 ++-- src/wallet/rpcwallet.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/cc/CCchannels.h b/src/cc/CCchannels.h index 30e1aeb78..9f84ba753 100644 --- a/src/cc/CCchannels.h +++ b/src/cc/CCchannels.h @@ -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(); diff --git a/src/cc/channels.cpp b/src/cc/channels.cpp index 098bfa2a3..fef4553d9 100644 --- a/src/cc/channels.cpp +++ b/src/cc/channels.cpp @@ -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(""); } diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 114f4e22d..c05f01d1a 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -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 destpub; struct CCcontract_info *cp,C; std::string hex; + UniValue result(UniValue::VOBJ); char destaddr[64]; int32_t numpayments; int64_t payment; std::vector 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 ) {