Add have-pubkey distinction to ISMINE flags
This indicates that, eg, we have a public key for a key which may be used as a pay-to-pubkey-hash. It generally means that we can create a valid scriptSig except for missing private key(s) with which to create signatures.
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#include "keystore.h"
|
||||
#include "script/script.h"
|
||||
#include "script/standard.h"
|
||||
#include "script/sign.h"
|
||||
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
@@ -40,7 +41,7 @@ isminetype IsMine(const CKeyStore &keystore, const CScript& scriptPubKey)
|
||||
txnouttype whichType;
|
||||
if (!Solver(scriptPubKey, whichType, vSolutions)) {
|
||||
if (keystore.HaveWatchOnly(scriptPubKey))
|
||||
return ISMINE_WATCH_ONLY;
|
||||
return ISMINE_WATCH_NOPUBKEY;
|
||||
return ISMINE_NO;
|
||||
}
|
||||
|
||||
@@ -85,7 +86,10 @@ isminetype IsMine(const CKeyStore &keystore, const CScript& scriptPubKey)
|
||||
}
|
||||
}
|
||||
|
||||
if (keystore.HaveWatchOnly(scriptPubKey))
|
||||
return ISMINE_WATCH_ONLY;
|
||||
if (keystore.HaveWatchOnly(scriptPubKey)) {
|
||||
// TODO: This could be optimized some by doing some work after the above solver
|
||||
CScript scriptSig;
|
||||
return ProduceSignature(DummySignatureCreator(&keystore), scriptPubKey, scriptSig) ? ISMINE_WATCH_PUBKEY : ISMINE_WATCH_NOPUBKEY;
|
||||
}
|
||||
return ISMINE_NO;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user