Recognizing CLTV transactions more broadly
This commit is contained in:
@@ -34,10 +34,21 @@ isminetype IsMine(const CKeyStore &keystore, const CTxDestination& dest)
|
||||
return IsMine(keystore, script);
|
||||
}
|
||||
|
||||
isminetype IsMine(const CKeyStore &keystore, const CScript& scriptPubKey)
|
||||
isminetype IsMine(const CKeyStore &keystore, const CScript& _scriptPubKey)
|
||||
{
|
||||
vector<valtype> vSolutions;
|
||||
txnouttype whichType;
|
||||
CScript scriptPubKey = _scriptPubKey;
|
||||
|
||||
if (scriptPubKey.IsCheckLockTimeVerify())
|
||||
{
|
||||
uint8_t pushOp = scriptPubKey.data()[0];
|
||||
uint32_t scriptStart = pushOp + 3;
|
||||
|
||||
// continue with post CLTV script
|
||||
scriptPubKey = CScript(scriptPubKey.size() > scriptStart ? scriptPubKey.begin() + scriptStart : scriptPubKey.end(), scriptPubKey.end());
|
||||
}
|
||||
|
||||
if (!Solver(scriptPubKey, whichType, vSolutions)) {
|
||||
if (keystore.HaveWatchOnly(scriptPubKey))
|
||||
return ISMINE_WATCH_ONLY;
|
||||
|
||||
Reference in New Issue
Block a user