aboutsummaryrefslogtreecommitdiff
path: root/src/script/ismine.h
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2016-10-17 00:32:36 +0800
committerJohnson Lau <jl2012@xbt.hk>2016-10-17 00:34:37 +0800
commit248f3a76a825a332e5495c5947ad283a9e5e938f (patch)
tree558883d85e04a20c45d9292659dd60c7b178599b /src/script/ismine.h
parentb811124202152424109b8e95ebe7ac25ff2e83c0 (diff)
downloadbitcoin-248f3a76a825a332e5495c5947ad283a9e5e938f.tar.xz
Fix ismine and addwitnessaddress: no uncompressed keys in segwit
Diffstat (limited to 'src/script/ismine.h')
-rw-r--r--src/script/ismine.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/script/ismine.h b/src/script/ismine.h
index 4b7db8802b..ec7a620e33 100644
--- a/src/script/ismine.h
+++ b/src/script/ismine.h
@@ -28,7 +28,14 @@ enum isminetype
/** used for bitflags of isminetype */
typedef uint8_t isminefilter;
-isminetype IsMine(const CKeyStore& keystore, const CScript& scriptPubKey);
-isminetype IsMine(const CKeyStore& keystore, const CTxDestination& dest);
+/* isInvalid becomes true when the script is found invalid by consensus or policy. This will terminate the recursion
+ * and return a ISMINE_NO immediately, as an invalid script should never be considered as "mine". This is needed as
+ * different SIGVERSION may have different network rules. Currently the only use of isInvalid is indicate uncompressed
+ * keys in SIGVERSION_WITNESS_V0 script, but could also be used in similar cases in the future
+ */
+isminetype IsMine(const CKeyStore& keystore, const CScript& scriptPubKey, bool& isInvalid, SigVersion = SIGVERSION_BASE);
+isminetype IsMine(const CKeyStore& keystore, const CScript& scriptPubKey, SigVersion = SIGVERSION_BASE);
+isminetype IsMine(const CKeyStore& keystore, const CTxDestination& dest, bool& isInvalid, SigVersion = SIGVERSION_BASE);
+isminetype IsMine(const CKeyStore& keystore, const CTxDestination& dest, SigVersion = SIGVERSION_BASE);
#endif // BITCOIN_SCRIPT_ISMINE_H