diff --git a/src/cc/dice.cpp b/src/cc/dice.cpp index 8054b798d..7d297c87a 100644 --- a/src/cc/dice.cpp +++ b/src/cc/dice.cpp @@ -127,7 +127,7 @@ int32_t DiceEntropyUsed(uint256 entropyused,uint256 bettxid,CTransaction betTx) fprintf(stderr,"found identical entropy used.%d\n",i); return(i+1); } - fprintf(stderr,"duplicate entropyused %s\n",entropyused.GetHex().c_str()); + fprintf(stderr,"duplicate entropyused %s bettxid.%s\n",entropyused.GetHex().c_str(),bettxid.GetHex().c_str()); return(-1); } } @@ -145,29 +145,26 @@ bool mySenddicetransaction(std::string res,uint256 entropyused,uint256 bettxid,C //fprintf(stderr,"%s\n%s\n",res.c_str(),uint256_str(str,tx.GetHash())); if ( (retval= DiceEntropyUsed(entropyused,bettxid,betTx)) >= 0 ) { - if ( retval == 0 ) - { - for (i=0; i %s to mempool\n",entropyused.GetHex().c_str(),bettxid.GetHex().c_str(),tx.GetHash().GetHex().c_str()); + } else fprintf(stderr,"error adding E.%s bet.%s -> %s to mempool, probably Disable replacement feature\n",entropyused.GetHex().c_str(),bettxid.GetHex().c_str(),tx.GetHash().GetHex().c_str()); } else fprintf(stderr,"error duplicate entropyused different bettxid\n"); } else fprintf(stderr,"error decoding hex\n"); } @@ -176,23 +173,23 @@ bool mySenddicetransaction(std::string res,uint256 entropyused,uint256 bettxid,C void *dicefinish(void *_ptr) { - char str[65],str2[65],name[32]; std::string res; int32_t i,result; struct dicefinish_info *ptr; uint256 entropyused; + char str[65],str2[65],name[32]; std::string res; int32_t i,result,maxiters=600; struct dicefinish_info *ptr; uint256 entropyused; ptr = (struct dicefinish_info *)_ptr; unstringbits(name,ptr->sbits); usleep((rand() % 1000000) + 100000); - for (i=0; i<600; i++) + for (i=0; ibettxid) != 0 ) // wait for bettxid to be in mempool { - fprintf(stderr,"i.%d dicefinish.%d %s funding.%s bet.%s\n",i,ptr->iswin,name,uint256_str(str,ptr->fundingtxid),uint256_str(str2,ptr->bettxid)); + //fprintf(stderr,"i.%d dicefinish.%d %s funding.%s bet.%s\n",i,ptr->iswin,name,uint256_str(str,ptr->fundingtxid),uint256_str(str2,ptr->bettxid)); res = DiceBetFinish(entropyused,&result,0,name,ptr->fundingtxid,ptr->bettxid,ptr->iswin); if ( result > 0 ) mySenddicetransaction(res,entropyused,ptr->bettxid,ptr->betTx); break; } } - if ( i == 600 ) + if ( i == maxiters ) fprintf(stderr,"dicefinish.%d %s bet.%s didnt arrive in mempool\n",ptr->iswin,name,uint256_str(str,ptr->bettxid)); free(ptr); return(0); diff --git a/src/main.cpp b/src/main.cpp index 65b0afa9c..cc69c215b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1387,7 +1387,7 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa //static uint32_t counter; // Disable replacement feature for now //if ( counter++ < 100 ) - fprintf(stderr,"Disable replacement feature for now\n"); + //fprintf(stderr,"Disable replacement feature for now\n"); return false; } } @@ -1438,7 +1438,7 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa { if (pfMissingInputs) *pfMissingInputs = true; - fprintf(stderr,"missing inputs\n"); + //fprintf(stderr,"missing inputs\n"); return false; } }