Enable time locked coin bases to be used as normal coinbase transactions with longer maturity, fix max_money

This commit is contained in:
miketout
2018-05-04 16:33:34 -07:00
parent 061f1a8ec5
commit e980a26ddd
16 changed files with 121 additions and 92 deletions

View File

@@ -74,34 +74,3 @@ const CScriptExt &CScriptExt::TimeLockSpend(const CKeyID &key, int64_t unlocktim
return *this;
}
// if the front of the script has check lock time verify. this is a fairly simple check.
// accepts NULL as parameter if unlockTime is not needed.
bool CScriptExt::IsCheckLockTimeVerify(int64_t *unlockTime) const
{
opcodetype op;
std::vector<unsigned char> unlockTimeParam = std::vector<unsigned char>();
CScript::const_iterator it = this->begin();
if (this->GetOp2(it, op, &unlockTimeParam))
{
if (unlockTimeParam.size() >= 0 && unlockTimeParam.size() < 6 &&
*(this->data() + unlockTimeParam.size() + 1) == OP_CHECKLOCKTIMEVERIFY)
{
int i = unlockTimeParam.size() - 1;
for (*unlockTime = 0; i >= 0; i--)
{
*unlockTime <<= 8;
*unlockTime |= *((unsigned char *)unlockTimeParam.data() + i);
}
return true;
}
}
return false;
}
bool CScriptExt::IsCheckLockTimeVerify() const
{
int64_t ult;
return this->IsCheckLockTimeVerify(&ult);
}