From 00f45e5f2f7c01d7992446b37862db09db7c5d09 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 8 Nov 2018 03:48:27 -1100 Subject: [PATCH] Test --- src/cc/dice.cpp | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/src/cc/dice.cpp b/src/cc/dice.cpp index 9e633730c..c30a2bc51 100644 --- a/src/cc/dice.cpp +++ b/src/cc/dice.cpp @@ -145,19 +145,7 @@ void _dicehash_add(uint256 bettxid) int32_t _dicerevealed_find(uint256 &oldbettxid,CTransaction &oldbetTx,uint256 entropyused,uint256 bettxid) { - int32_t i; struct dicefinish_info *ptr,*tmp; - DL_FOREACH_SAFE(DICEFINISH_LIST,ptr,tmp) - { - if ( ptr->entropyused == entropyused ) - { - if ( ptr->bettxid == bettxid ) - return(i+1); - fprintf(stderr,"found identical entropy used.%d different bettxid!\n",i); - oldbettxid = ptr->bettxid; - oldbetTx = ptr->betTx; - return(-1); - } - } + int32_t i; for (i=0; irevealed = (uint32_t)time(NULL); - else - { - pthread_mutex_lock(&DICEREVEALED_MUTEX); - _dicerevealed_add(entropyused,bettxid,betTx); - pthread_mutex_unlock(&DICEREVEALED_MUTEX); - } + pthread_mutex_lock(&DICEREVEALED_MUTEX); + _dicerevealed_add(entropyused,bettxid,betTx); + pthread_mutex_unlock(&DICEREVEALED_MUTEX); fprintf(stderr,"added.%c to mempool.[%d] and broadcast entropyused.%s bettxid.%s -> %s\n",funcid,i,entropyused.GetHex().c_str(),bettxid.GetHex().c_str(),tx.GetHash().GetHex().c_str()); } else fprintf(stderr,"rebroadcast.%c to mempool.[%d] and broadcast entropyused.%s bettxid.%s -> %s\n",funcid,i,entropyused.GetHex().c_str(),bettxid.GetHex().c_str(),tx.GetHash().GetHex().c_str()); @@ -429,6 +414,7 @@ void DiceQueue(int32_t iswin,uint64_t sbits,uint256 fundingtxid,uint256 bettxid, ptr->sbits = sbits; ptr->iswin = iswin; ptr->winamount = betTx.vout[1].nValue * ((betTx.vout[2].nValue - txfee)+1); + ptr->rawtx.clear(); DL_APPEND(DICEFINISH_LIST,ptr); //fprintf(stderr,"queued iswin.%d %s\n",iswin,bettxid.GetHex().c_str()); } else fprintf(stderr,"DiceQueue status bettxid.%s already in list\n",bettxid.GetHex().c_str());