Allow CNoDestination to represent a raw script

Even if a script is not a standard destination type, it can still be
useful to have a CTxDestination that stores the script.
This commit is contained in:
Andrew Chow
2023-08-09 09:31:50 -04:00
parent 8dd067088d
commit 1a98a51c66
2 changed files with 28 additions and 14 deletions

View File

@@ -93,6 +93,7 @@ bool ExtractDestination(const CScript& scriptPubKey, CTxDestination& addressRet)
case TxoutType::MULTISIG:
case TxoutType::NULL_DATA:
case TxoutType::NONSTANDARD:
addressRet = CNoDestination(scriptPubKey);
return false;
} // no default case, so the compiler can warn about missing cases
assert(false);
@@ -104,7 +105,7 @@ class CScriptVisitor
public:
CScript operator()(const CNoDestination& dest) const
{
return CScript();
return dest.GetScript();
}
CScript operator()(const PKHash& keyID) const