Merge pull request #723 from jl777/jl777
stricter tests for 100% PoS chains
This commit is contained in:
@@ -1248,7 +1248,9 @@ int32_t komodo_is_PoSblock(int32_t slowflag,int32_t height,CBlock *pblock,arith_
|
|||||||
{
|
{
|
||||||
CBlockIndex *previndex; char voutaddr[64],destaddr[64]; uint256 txid; uint32_t txtime,prevtime=0; int32_t vout,txn_count,eligible,isPoS = 0; uint64_t value; CTxDestination voutaddress;
|
CBlockIndex *previndex; char voutaddr[64],destaddr[64]; uint256 txid; uint32_t txtime,prevtime=0; int32_t vout,txn_count,eligible,isPoS = 0; uint64_t value; CTxDestination voutaddress;
|
||||||
txn_count = pblock->vtx.size();
|
txn_count = pblock->vtx.size();
|
||||||
if ( txn_count > 1 )
|
if ( ASSETCHAINS_STAKED == 100 && height < 1000 )
|
||||||
|
return(1);
|
||||||
|
if ( txn_count > 1 && pblock->vtx[txn_count-1].vout.size() == 1 )
|
||||||
{
|
{
|
||||||
if ( prevtime == 0 )
|
if ( prevtime == 0 )
|
||||||
{
|
{
|
||||||
@@ -1265,7 +1267,7 @@ int32_t komodo_is_PoSblock(int32_t slowflag,int32_t height,CBlock *pblock,arith_
|
|||||||
fprintf(stderr,"komodo_is_PoSblock PoS failure ht.%d eligible.%u vs blocktime.%u, lag.%d -> check to see if it is PoW block\n",height,eligible,(uint32_t)pblock->nTime,(int32_t)(eligible - pblock->nTime));
|
fprintf(stderr,"komodo_is_PoSblock PoS failure ht.%d eligible.%u vs blocktime.%u, lag.%d -> check to see if it is PoW block\n",height,eligible,(uint32_t)pblock->nTime,(int32_t)(eligible - pblock->nTime));
|
||||||
} else isPoS = 1;
|
} else isPoS = 1;
|
||||||
}
|
}
|
||||||
else if ( slowflag == 0 ) // maybe previous block is not seen yet, do the best approx
|
if ( slowflag == 0 ) // maybe previous block is not seen yet, do the best approx
|
||||||
{
|
{
|
||||||
txtime = komodo_txtime(&value,txid,vout,destaddr);
|
txtime = komodo_txtime(&value,txid,vout,destaddr);
|
||||||
if ( ExtractDestination(pblock->vtx[txn_count-1].vout[0].scriptPubKey,voutaddress) )
|
if ( ExtractDestination(pblock->vtx[txn_count-1].vout[0].scriptPubKey,voutaddress) )
|
||||||
|
|||||||
Reference in New Issue
Block a user