16 typedef std::vector<unsigned char>
valtype;
20 unsigned int nResult = 0;
21 for (
const valtype& pubkey : pubkeys) {
32 return IsMine(keystore, script);
43 }
else if (!ivk.
IsNull()) {
52 class CWDestinationVisitor :
public boost::static_visitor<isminetype>
57 explicit CWDestinationVisitor(
const CKeyStore& _keystore) : keystore(_keystore) {}
71 return boost::apply_visitor(CWDestinationVisitor(keystore), dest);
76 std::vector<valtype> vSolutions;
78 if(!
Solver(scriptPubKey, whichType, vSolutions)) {
105 if(keystore.
GetCScript(scriptID, subscript)) {
114 bool stakeKeyIsMine = keystore.
HaveKey(stakeKeyID);
116 bool spendKeyIsMine = keystore.
HaveKey(ownerKeyID);
118 if (spendKeyIsMine) {
122 }
else if (stakeKeyIsMine) {
135 std::vector<valtype> keys(vSolutions.begin() + 1, vSolutions.begin() + vSolutions.size() - 1);
136 if(
HaveKeys(keys, keystore) == keys.size())
A reference to a CKey: the Hash160 of its serialized public key.
A virtual base class for key stores.
virtual bool HaveWatchOnly(const CScript &dest) const =0
virtual bool GetSaplingIncomingViewingKey(const libzcash::SaplingPaymentAddress &addr, libzcash::SaplingIncomingViewingKey &ivkOut) const =0
virtual bool HaveSaplingSpendingKey(const libzcash::SaplingExtendedFullViewingKey &extfvk) const =0
virtual bool HaveKey(const CKeyID &address) const =0
Check whether a key corresponding to a given address is present in the store.
virtual bool GetCScript(const CScriptID &hash, CScript &redeemScriptOut) const =0
virtual bool GetSaplingFullViewingKey(const libzcash::SaplingIncomingViewingKey &ivk, libzcash::SaplingExtendedFullViewingKey &extfvkOut) const =0
An encapsulated public key.
CKeyID GetID() const
Get the KeyID of this public key (hash of its serialization)
Serialized script, used inside transaction inputs and outputs.
A reference to a CScript: the Hash160 of its serialization (see script.h)
boost::variant< CTxDestination, libzcash::SaplingPaymentAddress > CWDestination
std::vector< unsigned char > valtype
std::vector< unsigned char > valtype
unsigned int HaveKeys(const std::vector< valtype > &pubkeys, const CKeyStore &keystore)
isminetype IsMine(const CKeyStore &keystore, const CTxDestination &dest)
isminetype
IsMine() return codes.
@ ISMINE_COLD
Indicates that we have the staking key of a P2CS.
@ ISMINE_SPENDABLE_SHIELDED
Indicates that we have the spending key of a shielded spend/output.
@ ISMINE_WATCH_ONLY_SHIELDED
Indicates that we don't have the spending key of a shielded spend/output.
@ ISMINE_SPENDABLE_DELEGATED
Indicates that we have the spending key of a P2CS.
bool Solver(const CScript &scriptPubKey, txnouttype &typeRet, std::vector< std::vector< unsigned char > > &vSolutionsRet)
Parse a scriptPubKey and identify script type for standard scripts.
CScript GetScriptForDestination(const CTxDestination &dest)
Generate a PIVX scriptPubKey for the given CTxDestination.
boost::variant< CNoDestination, CKeyID, CScriptID, CExchangeKeyID > CTxDestination
A txout script template with a specific destination.