Test
This commit is contained in:
@@ -621,13 +621,13 @@ int32_t komodo_block2height(CBlock *block)
|
||||
//for (i=0; i<6; i++)
|
||||
// printf("%02x",ptr[i]);
|
||||
n = ptr[0];
|
||||
for (i=n-4-1; i<n; i++)
|
||||
for (i=0; i<n; i++)
|
||||
{
|
||||
//03bb81000101(bb 187) (81 48001) (00 12288256) <- coinbase.6 ht.12288256
|
||||
height += ((uint32_t)ptr[i+1] << (i*8));
|
||||
//printf("(%02x %x %d) ",ptr[i+1],((uint32_t)ptr[i+1] << (i*8)),height);
|
||||
}
|
||||
//printf(" <- coinbase.%d ht.%d\n",(int32_t)block->vtx[0].vin[0].scriptSig.size(),height);
|
||||
printf(" <- coinbase.%d ht.%d\n",(int32_t)block->vtx[0].vin[0].scriptSig.size(),height);
|
||||
}
|
||||
//komodo_init(height);
|
||||
}
|
||||
|
||||
@@ -3539,7 +3539,7 @@ bool CheckBlock(int32_t height,CBlockIndex *pindex,const CBlock& block, CValidat
|
||||
// Check transactions
|
||||
BOOST_FOREACH(const CTransaction& tx, block.vtx)
|
||||
{
|
||||
if ( komodo_validate_interest(tx,komodo_block2height((CBlock *)&block),block.nTime,1) < 0 )
|
||||
if ( komodo_validate_interest(tx,height == 0 ? komodo_block2height((CBlock *)&block) : height,block.nTime,1) < 0 )
|
||||
return error("CheckBlock: komodo_validate_interest failed");
|
||||
if (!CheckTransaction(tx, state, verifier))
|
||||
return error("CheckBlock(): CheckTransaction failed");
|
||||
|
||||
Reference in New Issue
Block a user