From 9841d2984e853a06ccc736cfa9d91e5b8405bbe6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 10 Nov 2018 03:10:10 -1100 Subject: [PATCH] Test --- src/cc/CCinclude.h | 2 +- src/cc/channels.cpp | 6 +++--- src/cc/lotto.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/cc/CCinclude.h b/src/cc/CCinclude.h index aa5e731b3..41f5ccacd 100644 --- a/src/cc/CCinclude.h +++ b/src/cc/CCinclude.h @@ -125,7 +125,7 @@ CPubKey GetUnspendable(struct CCcontract_info *cp,uint8_t *unspendablepriv); // CCutils CPubKey buf2pk(uint8_t *buf33); void endiancpy(uint8_t *dest,uint8_t *src,int32_t len); -uint256 DiceHashEntropy(uint256 &entropy,uint256 _txidpriv); +uint256 DiceHashEntropy(uint256 &entropy,uint256 _txidpriv,int32_t entropyvout); CTxOut MakeCC1vout(uint8_t evalcode,CAmount nValue,CPubKey pk); CTxOut MakeCC1of2vout(uint8_t evalcode,CAmount nValue,CPubKey pk,CPubKey pk2); CC *MakeCCcond1(uint8_t evalcode,CPubKey pk); diff --git a/src/cc/channels.cpp b/src/cc/channels.cpp index 672e426a8..e5b77feb2 100644 --- a/src/cc/channels.cpp +++ b/src/cc/channels.cpp @@ -446,7 +446,7 @@ std::string ChannelOpen(uint64_t txfee,CPubKey destpub,int32_t numpayments,int64 funds = numpayments * payment; if ( AddNormalinputs(mtx,mypk,funds+3*txfee,64) > 0 ) { - hentropy = DiceHashEntropy(entropy,mtx.vin[0].prevout.hash); + hentropy = DiceHashEntropy(entropy,mtx.vin[0].prevout.hash,mtx.vin[0].prevout.n); endiancpy(hash,(uint8_t *)&hentropy,32); for (i=0; i 0 && DecodeChannelsOpRet(prevTx.vout[numvouts-1].scriptPubKey, txid, srcpub, destpub, param1, param2, param3) != 0) { - hentropy = DiceHashEntropy(entropy, channelOpenTx.vin[0].prevout.hash); + hentropy = DiceHashEntropy(entropy, channelOpenTx.vin[0].prevout.hash, channelOpenTx.vin[0].prevout.n); endiancpy(hash, (uint8_t * ) & hentropy, 32); for (i = 0; i < param1; i++) { diff --git a/src/cc/lotto.cpp b/src/cc/lotto.cpp index d6d881603..6361b9291 100644 --- a/src/cc/lotto.cpp +++ b/src/cc/lotto.cpp @@ -292,7 +292,7 @@ std::string LottoCreate(uint64_t txfee,char *planstr,int64_t funding,int32_t tic sbits = stringbits(planstr); if ( AddNormalinputs(mtx,mypk,funding+txfee,60) > 0 ) { - hentropy = DiceHashEntropy(entropy,mtx.vin[0].prevout.hash); + hentropy = DiceHashEntropy(entropy,mtx.vin[0].prevout.hash,mtx.vin[0].prevout.n); mtx.vout.push_back(MakeCC1vout(EVAL_LOTTO,funding,lottopk)); return(FinalizeCCTx(0,cp,mtx,mypk,txfee,CScript() << OP_RETURN << E_MARSHAL(ss << (uint8_t)EVAL_LOTTO << (uint8_t)'F' << sbits << ticketsize << odds << firstheight << period << hentropy))); }