diff --git a/src/cc/CCinclude.h b/src/cc/CCinclude.h index 0be8a7e98..29bdcf900 100644 --- a/src/cc/CCinclude.h +++ b/src/cc/CCinclude.h @@ -50,6 +50,7 @@ extern CWallet* pwalletMain; bool GetAddressUnspent(uint160 addressHash, int type,std::vector > &unspentOutputs); static const uint256 zeroid; +bool myGetTransaction(const uint256 &hash, CTransaction &txOut, uint256 &hashBlock); // CCcustom CPubKey GetUnspendable(struct CCcontract_info *cp,uint8_t *unspendablepriv); diff --git a/src/cc/CCutils.cpp b/src/cc/CCutils.cpp index c4e5be3fb..622a50fe8 100644 --- a/src/cc/CCutils.cpp +++ b/src/cc/CCutils.cpp @@ -277,7 +277,7 @@ bool ProcessCC(struct CCcontract_info *cp,Eval* eval, std::vector param int64_t CCduration(uint256 txid) { CTransaction tx; uint256 hashBlock; uint32_t txtime=0; char str[65]; CBlockIndex *pindex; int64_t duration = 0; - if ( GetTransaction(txid,tx,hashBlock,false) == 0 ) + if ( myGetTransaction(txid,tx,hashBlock) == 0 ) { fprintf(stderr,"CCduration cant find duration txid %s\n",uint256_str(str,txid)); return(0); diff --git a/src/cc/dice.cpp b/src/cc/dice.cpp index f905c77b4..1d9dfd5bd 100644 --- a/src/cc/dice.cpp +++ b/src/cc/dice.cpp @@ -411,7 +411,7 @@ bool DiceValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &tx) if ( (iswin= DiceIsWinner(entropy,txid,tx,vinTx,hash,sbits,minbet,maxbet,maxodds,timeoutblocks,fundingtxid)) != 0 ) { fprintf(stderr,"DiceIsWinner.%d\n",iswin); - //DiceQueue(iswin,sbits,fundingtxid,txid); + DiceQueue(iswin,sbits,fundingtxid,txid); } //return eval->Invalid("dont confirm bet during debug"); break; diff --git a/src/cc/eval.cpp b/src/cc/eval.cpp index d685c82cd..95f5c33de 100644 --- a/src/cc/eval.cpp +++ b/src/cc/eval.cpp @@ -98,7 +98,6 @@ bool Eval::GetSpendsConfirmed(uint256 hash, std::vector &spends) c bool Eval::GetTxUnconfirmed(const uint256 &hash, CTransaction &txOut, uint256 &hashBlock) const { - bool myGetTransaction(const uint256 &hash, CTransaction &txOut, uint256 &hashBlock); // there is a LOCK(cs_main) in the normal GetTransaction(), which leads to deadlocks //bool fAllowSlow = false; // Don't allow slow //return GetTransaction(hash, txOut, hashBlock, fAllowSlow); diff --git a/src/cc/rewards.cpp b/src/cc/rewards.cpp index 88c92198a..c2f6dcd27 100644 --- a/src/cc/rewards.cpp +++ b/src/cc/rewards.cpp @@ -72,6 +72,7 @@ uint64_t RewardsCalc(uint64_t amount,uint256 txid,uint64_t APR,uint64_t minsecon fprintf(stderr,"minseconds %llu maxseconds %llu\n",(long long)minseconds,(long long)maxseconds); if ( (duration= CCduration(txid)) < minseconds ) { + fprintf(stderr,"duration %llu < minseconds %llu\n",(long long)duration,(long long)minseconds); return(0); //duration = (uint32_t)time(NULL) - (1532713903 - 3600 * 24); } else if ( duration > maxseconds )