From aa760cb89278bc2b6a8e842964890b59c896c537 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 31 Jul 2018 22:53:00 -1100 Subject: [PATCH] Test --- src/cc/dice.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cc/dice.cpp b/src/cc/dice.cpp index 6b926b3b1..06d0f9bf8 100644 --- a/src/cc/dice.cpp +++ b/src/cc/dice.cpp @@ -201,6 +201,8 @@ uint64_t DiceCalc(int64_t bet,int64_t odds,int64_t minbet,int64_t maxbet,int64_t fprintf(stderr,"bet size violation %.8f\n",(double)bet/COIN); return(0); } + fprintf(stderr,"calc house entropy %s vs bettor %s\n",uint256_str(str,houseentropy),uin256_str(str2,bettorentropy)); + endiancpy(buf,(uint8_t *)&houseentropy,32); endiancpy(&buf[32],(uint8_t *)&bettorentropy,32); vcalc_sha256(0,(uint8_t *)&_house,buf,64); @@ -485,7 +487,9 @@ bool DiceValidate(struct CCcontract_info *cp,Eval *eval,const CTransaction &tx) } if ( iswin != 0 ) { + char str[65],str2[65]; entropy = DiceGetEntropy(vinTx,'B'); + fprintf(stderr,"verify house entropy %s vs bettor %s\n",uint256_str(str,proof),uin256_str(str2,entropy)); winnings = DiceCalc(vinTx.vout[1].nValue,vinTx.vout[2].nValue,minbet,maxbet,maxodds,timeoutblocks,proof,entropy); if ( (winnings == 0 && iswin > 0) || (winnings > 0 && iswin < 0) ) return eval->Invalid("DiceCalc mismatch for win/loss");