diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2014-06-09 21:11:59 +0200 |
---|---|---|
committer | JaSK <temp@temp.temp> | 2014-07-02 15:48:39 +0200 |
commit | d5087d1ba08142bdf135333a0da08ef0f5fc7ef0 (patch) | |
tree | 42c945e1a21db1c7b9bfe9a91f8ee47f9eb7b49a /src/script.h | |
parent | 0fa2f8899adf8f9f0ead29ba5d708ead6c5d4eaf (diff) |
Use script matching rather than destination matching for watch-only.
This changes the keystore data format, wallet format and IsMine logic
to detect watch-only outputs based on direct script matching rather
than first trying to convert outputs to destinations (addresses).
The reason is that we don't know how the software that has the spending
keys works. It may support the same types of scripts as us, but that is
not guaranteed. Furthermore, it removes the ambiguity between addresses
used as identifiers for output scripts or identifiers for public keys.
One practical implication is that adding a normal pay-to-pubkey-hash
address via importaddress will not cause payments to the corresponding
full public key to be detected as IsMine. If that is wanted, add those
scripts directly (importaddress now also accepts any hex-encoded script).
Conflicts:
src/wallet.cpp
Diffstat (limited to 'src/script.h')
-rw-r--r-- | src/script.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/script.h b/src/script.h index 56c7d01d4e..edba5757e4 100644 --- a/src/script.h +++ b/src/script.h @@ -812,7 +812,7 @@ bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, std::vector<std::v int ScriptSigArgsExpected(txnouttype t, const std::vector<std::vector<unsigned char> >& vSolutions); bool IsStandard(const CScript& scriptPubKey, txnouttype& whichType); isminetype IsMine(const CKeyStore& keystore, const CScript& scriptPubKey); -isminetype IsMine(const CKeyStore& keystore, const CTxDestination &dest); +isminetype IsMine(const CKeyStore& keystore, const CTxDestination& dest); void ExtractAffectedKeys(const CKeyStore &keystore, const CScript& scriptPubKey, std::vector<CKeyID> &vKeys); bool ExtractDestination(const CScript& scriptPubKey, CTxDestination& addressRet); bool ExtractDestinations(const CScript& scriptPubKey, txnouttype& typeRet, std::vector<CTxDestination>& addressRet, int& nRequiredRet); |