SQUASH "Add have-pubkey distinction to ISMINE flags"

This commit is contained in:
Matt Corallo 2015-08-08 09:26:07 -07:00
parent 6bdb474dc9
commit 428a898acd
2 changed files with 5 additions and 5 deletions

View File

@ -41,7 +41,7 @@ isminetype IsMine(const CKeyStore &keystore, const CScript& scriptPubKey)
txnouttype whichType; txnouttype whichType;
if (!Solver(scriptPubKey, whichType, vSolutions)) { if (!Solver(scriptPubKey, whichType, vSolutions)) {
if (keystore.HaveWatchOnly(scriptPubKey)) if (keystore.HaveWatchOnly(scriptPubKey))
return ISMINE_WATCH_NOPUBKEY; return ISMINE_WATCH_UNSOLVABLE;
return ISMINE_NO; return ISMINE_NO;
} }
@ -89,7 +89,7 @@ isminetype IsMine(const CKeyStore &keystore, const CScript& scriptPubKey)
if (keystore.HaveWatchOnly(scriptPubKey)) { if (keystore.HaveWatchOnly(scriptPubKey)) {
// TODO: This could be optimized some by doing some work after the above solver // TODO: This could be optimized some by doing some work after the above solver
CScript scriptSig; CScript scriptSig;
return ProduceSignature(DummySignatureCreator(&keystore), scriptPubKey, scriptSig) ? ISMINE_WATCH_PUBKEY : ISMINE_WATCH_NOPUBKEY; return ProduceSignature(DummySignatureCreator(&keystore), scriptPubKey, scriptSig) ? ISMINE_WATCH_SOLVABLE : ISMINE_WATCH_UNSOLVABLE;
} }
return ISMINE_NO; return ISMINE_NO;
} }

View File

@ -17,10 +17,10 @@ enum isminetype
{ {
ISMINE_NO = 0, ISMINE_NO = 0,
//! Indicates that we dont know how to create a scriptSig that would solve this if we were given the appropriate private keys //! Indicates that we dont know how to create a scriptSig that would solve this if we were given the appropriate private keys
ISMINE_WATCH_NOPUBKEY = 1, ISMINE_WATCH_UNSOLVABLE = 1,
//! Indicates that we know how to create a scriptSig that would solve this if we were given the appropriate private keys //! Indicates that we know how to create a scriptSig that would solve this if we were given the appropriate private keys
ISMINE_WATCH_PUBKEY = 2, ISMINE_WATCH_SOLVABLE = 2,
ISMINE_WATCH_ONLY = ISMINE_WATCH_NOPUBKEY | ISMINE_WATCH_PUBKEY, ISMINE_WATCH_ONLY = ISMINE_WATCH_SOLVABLE | ISMINE_WATCH_UNSOLVABLE,
ISMINE_SPENDABLE = 4, ISMINE_SPENDABLE = 4,
ISMINE_ALL = ISMINE_WATCH_ONLY | ISMINE_SPENDABLE ISMINE_ALL = ISMINE_WATCH_ONLY | ISMINE_SPENDABLE
}; };