diff --git a/src/cc/dice.cpp b/src/cc/dice.cpp index e864612f1..12143acc2 100644 --- a/src/cc/dice.cpp +++ b/src/cc/dice.cpp @@ -128,10 +128,10 @@ bool mySenddicetransaction(std::string res,uint256 entropyused,uint256 bettxid) if ( DecodeHexTx(tx,res) != 0 ) { //fprintf(stderr,"%s\n%s\n",res.c_str(),uint256_str(str,tx.GetHash())); - LOCK(cs_main); - if ( myAddtomempool(tx) != 0 ) + if ( DiceEntropyUsed(entropyused,bettxid) == 0 ) { - if ( DiceEntropyUsed(entropyused,bettxid) == 0 ) + LOCK(cs_main); + if ( myAddtomempool(tx) != 0 ) { RelayTransaction(tx); for (i=0; i txid.%s\n",i,entropyused.GetHex().c_str(),bettxid.GetHex().c_str(),tx.GetHash().GetHex().c_str()); + return(true); } - return(true); } else fprintf(stderr,"error adding to mempool\n"); } else fprintf(stderr,"error decoding hex\n"); }