Sapling transaction testing
This commit is contained in:
@@ -234,7 +234,7 @@ bool IsStandard(const CScript& scriptPubKey, txnouttype& whichType)
|
||||
return whichType != TX_NONSTANDARD;
|
||||
}
|
||||
|
||||
bool ExtractDestination(const CScript& _scriptPubKey, CTxDestination& addressRet)
|
||||
bool ExtractDestination(const CScript& _scriptPubKey, CTxDestination& addressRet, bool returnPubKey)
|
||||
{
|
||||
vector<valtype> vSolutions;
|
||||
txnouttype whichType;
|
||||
@@ -262,9 +262,13 @@ bool ExtractDestination(const CScript& _scriptPubKey, CTxDestination& addressRet
|
||||
return false;
|
||||
}
|
||||
|
||||
addressRet = pubKey.GetID();
|
||||
if (returnPubKey)
|
||||
addressRet = pubKey;
|
||||
else
|
||||
addressRet = pubKey.GetID();
|
||||
return true;
|
||||
}
|
||||
|
||||
else if (whichType == TX_PUBKEYHASH)
|
||||
{
|
||||
addressRet = CKeyID(uint160(vSolutions[0]));
|
||||
@@ -355,6 +359,12 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
bool operator()(const CPubKey &key) const {
|
||||
script->clear();
|
||||
*script << ToByteVector(key) << OP_CHECKSIG;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool operator()(const CKeyID &keyID) const {
|
||||
script->clear();
|
||||
*script << OP_DUP << OP_HASH160 << ToByteVector(keyID) << OP_EQUALVERIFY << OP_CHECKSIG;
|
||||
|
||||
Reference in New Issue
Block a user