diff --git a/src/cc/gamescc.cpp b/src/cc/gamescc.cpp index 7628db500..1a7ce0257 100644 --- a/src/cc/gamescc.cpp +++ b/src/cc/gamescc.cpp @@ -166,17 +166,17 @@ UniValue games_register(uint64_t txfee,struct CCcontract_info *cp,cJSON *params) int32_t games_eventsign(std::vector &sig,std::vector payload,CPubKey pk) { - bool signSuccess; SignatureData sigdata; uint256 hash; uint8_t *ptr; auto consensusBranchId = 0; + bool signSuccess; SignatureData sigdata; int32_t i,siglen; uint256 hash; uint8_t *ptr; auto consensusBranchId = 0; CMutableTransaction txNew; const CKeyStore& keystore = *pwalletMain; txNew.vin.resize(1); txNew.vout.resize(1); txNew.vin[0].prevout.hash = payload.GetHash(); txNew.vin[0].prevout.n = 0; - txNew.vout[0].scriptPubKey = CScript() << payload << OP_DROP << ParseHex(HexString(pk)) << OP_CHECKSIG; - txNew.vout[0].nValue = (int32_t)payload.size(); + txNew.vout[0].scriptPubKey = CScript() << payload << OP_DROP << ParseHex(HexStr(pk)) << OP_CHECKSIG; + txNew.vout[0].nValue = payload.size(); txNew.nLockTime = 0; CTransaction txNewConst(txNew); - signSuccess = ProduceSignature(TransactionSignatureCreator(&keystore, &txNewConst, 0, *utxovaluep, SIGHASH_ALL), txNew.vout[0].scriptPubKey, sigdata, consensusBranchId); + signSuccess = ProduceSignature(TransactionSignatureCreator(&keystore, &txNewConst, 0, payload.size(), SIGHASH_ALL), txNew.vout[0].scriptPubKey, sigdata, consensusBranchId); if ( signSuccess > 0 ) { UpdateTransaction(txNew,0,sigdata); diff --git a/src/cc/gamescc.h b/src/cc/gamescc.h index 02f589056..6e88b9e32 100644 --- a/src/cc/gamescc.h +++ b/src/cc/gamescc.h @@ -1,3 +1,4 @@ +#include "CCinclud.h" std::string MYCCLIBNAME = (char *)"gamescc"; diff --git a/src/cc/payments.cpp b/src/cc/payments.cpp index 0190bf198..75c1431f0 100644 --- a/src/cc/payments.cpp +++ b/src/cc/payments.cpp @@ -569,7 +569,7 @@ UniValue PaymentsRelease(struct CCcontract_info *cp,char *jsonstr) UniValue PaymentsFund(struct CCcontract_info *cp,char *jsonstr) { CMutableTransaction mtx = CreateNewContextualCMutableTransaction(Params().GetConsensus(), komodo_nextheight()); UniValue result(UniValue::VOBJ); - CPubKey Paymentspk,mypk,txidpk; uint256 txid,hashBlock; int64_t amount; CScript opret; CTransaction tx; char txidaddr[64]; std::string rawtx; int32_t n,useopret = 0,lockedblocks,minrelease,totalallocations; std::vector txidoprets; + CPubKey Paymentspk,mypk,txidpk; uint256 txid,hashBlock; int64_t amount,totalallocations; CScript opret; CTransaction tx; char txidaddr[64]; std::string rawtx; int32_t n,useopret = 0,lockedblocks,minrelease; std::vector txidoprets; cJSON *params = payments_reparse(&n,jsonstr); mypk = pubkey2pk(Mypubkey()); Paymentspk = GetUnspendable(cp,0); @@ -662,7 +662,7 @@ UniValue PaymentsTxidopret(struct CCcontract_info *cp,char *jsonstr) UniValue PaymentsCreate(struct CCcontract_info *cp,char *jsonstr) { CMutableTransaction mtx = CreateNewContextualCMutableTransaction(Params().GetConsensus(), komodo_nextheight()); - UniValue result(UniValue::VOBJ); CTransaction tx; CPubKey Paymentspk,mypk; char markeraddr[64]; std::vector txidoprets; uint256 hashBlock; int32_t i,n,numoprets=0,lockedblocks,minrelease,totalallocations=0; std::string rawtx; + UniValue result(UniValue::VOBJ); CTransaction tx; CPubKey Paymentspk,mypk; char markeraddr[64]; std::vector txidoprets; uint256 hashBlock; int32_t i,n,numoprets=0,lockedblocks,minrelease; std::string rawtx; int64_t totalallocations = 0; cJSON *params = payments_reparse(&n,jsonstr); if ( params != 0 && n >= 4 ) {