This commit is contained in:
jl777
2016-10-31 17:40:17 -03:00
parent 92bf98e5c7
commit 8f64a3a95d
2 changed files with 6 additions and 6 deletions

View File

@@ -149,7 +149,7 @@ int32_t komodo_gateway_depositremove(uint256 txid,uint16_t vout) // assetchain c
return(n);
}
int32_t komodo_check_deposit(const CBlock& block) // verify above block is valid pax pricing
int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above block is valid pax pricing
{
int32_t i,j,n,opretlen,num,iter,matchflag,offset=1; uint256 hash,txids[64]; uint8_t shortflag; char base[16]; uint16_t vouts[64]; uint8_t *script; queue_t *Q; struct pax_transaction *ptr; struct queueitem *item;
n = block.vtx[0].vout.size();
@@ -157,7 +157,7 @@ int32_t komodo_check_deposit(const CBlock& block) // verify above block is valid
if ( n <= 2 || script[0] != 0x6a )
return(0);
offset += komodo_scriptitemlen(&opretlen,&script[offset]);
printf("checkdeposit n.%d [%02x] [%c] %d vs %d\n",n,script[0],script[offset],script[offset],'I');
//printf("checkdeposit n.%d [%02x] [%c] %d vs %d\n",n,script[0],script[offset],script[offset],'I');
if ( script[offset] == 'I' && opretlen < block.vtx[0].vout[n-1].scriptPubKey.size() )
{
if ( (num= komodo_issued_opreturn(&shortflag,base,txids,vouts,&script[offset],opretlen)) > 0 )
@@ -200,8 +200,8 @@ int32_t komodo_check_deposit(const CBlock& block) // verify above block is valid
hash = block.GetHash();
for (j=0; j<32; j++)
printf("%02x",((uint8_t *)&hash)[j]);
printf(" blockhash couldnt find vout.[%d]\n",i);
return(-1);
printf(" ht.%d blockhash couldnt find vout.[%d]\n",height,i);
//return(-1);
}
}
}

View File

@@ -3050,7 +3050,7 @@ bool CheckBlockHeader(int32_t height,CBlockIndex *pindex, const CBlockHeader& bl
return true;
}
int32_t komodo_check_deposit(const CBlock& block);
int32_t komodo_check_deposit(int32_t height,const CBlock& block);
bool CheckBlock(int32_t height,CBlockIndex *pindex,const CBlock& block, CValidationState& state, bool fCheckPOW, bool fCheckMerkleRoot)
{
// These are checks that are independent of context.
@@ -3107,7 +3107,7 @@ bool CheckBlock(int32_t height,CBlockIndex *pindex,const CBlock& block, CValidat
if (nSigOps > MAX_BLOCK_SIGOPS)
return state.DoS(100, error("CheckBlock(): out-of-bounds SigOpCount"),
REJECT_INVALID, "bad-blk-sigops", true);
if ( komodo_check_deposit(block) < 0 )
if ( komodo_check_deposit(height,block) < 0 )
return(false);
return true;
}