From 77fb34804d56265acec751378c80c5d208349283 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 7 Nov 2018 03:42:31 -1100 Subject: [PATCH] Test --- src/cc/dice.cpp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/cc/dice.cpp b/src/cc/dice.cpp index cefb8a2f8..76715fc0d 100644 --- a/src/cc/dice.cpp +++ b/src/cc/dice.cpp @@ -792,10 +792,10 @@ int64_t DicePlanFunds(uint64_t &entropyval,uint256 &entropytxid,uint64_t refsbit { if ( (funcid == 'F' && reffundingtxid == txid) || reffundingtxid == fundingtxid ) { - if ( refsbits == sbits && (nValue= IsDicevout(cp,tx,vout,refsbits,reffundingtxid)) > 10000 && (funcid == 'F' || funcid == 'E' || funcid == 'W' || funcid == 'L' || funcid == 'T') ) + if ( refsbits == sbits && (nValue= IsDicevout(cp,tx,vout,refsbits,reffundingtxid)) >= 10000 && (funcid == 'F' || funcid == 'E' || funcid == 'W' || funcid == 'L' || funcid == 'T') ) { //fprintf(stderr,"%s.(%c %.8f) ",uint256_str(str,txid),funcid,(double)nValue/COIN); - if ( funcid != 'F' && funcid != 'T' ) + if ( funcid == 'L' || funcid == 'W' || funcid == 'E' ) n++; totalinputs += nValue; if ( first == 0 && (funcid == 'E' || funcid == 'W' || funcid == 'L') ) @@ -808,6 +808,11 @@ int64_t DicePlanFunds(uint64_t &entropyval,uint256 &entropytxid,uint64_t refsbit fprintf(stderr,"cant find entropy vin0 %s or vin0prev %d vouts[%d], iscoinbase.%d\n",uint256_str(str,tx.vin[0].prevout.hash),(int32_t)tx.vin[0].prevout.n,(int32_t)vinTx.vout.size(),(int32_t)vinTx.vin.size()); continue; } + if ( (int32_t)vinTx.vin[0].prevout.n < 0 ) + { + //fprintf(stderr,"skip coinbase\n"); + continue; + } if ( funcid == 'E' ) { if ( fundingtxid != tx.vin[0].prevout.hash && vinTx.vout[tx.vin[0].prevout.n].scriptPubKey != fundingPubKey ) @@ -824,18 +829,9 @@ int64_t DicePlanFunds(uint64_t &entropyval,uint256 &entropytxid,uint64_t refsbit continue; } } - else - { - //fprintf(stderr,"txid.%s vinTx.vin[0].prevout.n %d %d\n",txid.GetHex().c_str(),(int32_t)vinTx.vin[0].prevout.n,(int32_t)vinTx.vin[0].prevout.n < 0); - if ( (int32_t)vinTx.vin[0].prevout.n < 0 ) - { - //fprintf(stderr,"skip coinbase\n"); - continue; - } - } entropytxid = txid; entropyval = tx.vout[0].nValue; - fprintf(stderr,"first.%d entropytxid.%s val %.8f\n",first,txid.GetHex().c_str(),(double)entropyval/COIN); + fprintf(stderr,"funcid.%c first.%d entropytxid.%s val %.8f\n",funcid,first,txid.GetHex().c_str(),(double)entropyval/COIN); first = 1; if (random) { fprintf(stderr, "chosen entropy on loop: %d\n",loops);