static const int64 collateral = 250000 * COIN;
bool iscolletaraltx (){
if (pindex->nHeight>85000){
for (int i = 0; i < block.vtx[0].vout.size(); i++) {
if (block.vtx[0].vout[i].nValue == collateral) {
return true;
}
}
}
}
int CMerkleTx::GetBlocksToMaturity() const
{
if (!IsCoinBase())
return 0;
//special rule for colletaral tx
if(iscolletaraltx()){
//Period
int64_t collateraltxblock =GetDepthInMainChain()+100000;
if(chainActive.Tip()->nHeight< collateraltxblock){
return collateraltxblock - chainActive.Tip()->nHeight;
}
}
return max(0, (COINBASE_MATURITY) - GetDepthInMainChain());
}
that's what i've got so far...
or maybe I can use this :- https://github.com/bitcoin/bitcoin/compare/master...petertodd:checklocktimeverify
not sure which is better