aboutsummaryrefslogtreecommitdiff
path: root/src/key.h
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2012-01-26 19:26:34 +0100
committerLuke Dashjr <luke-jr+git@utopios.org>2012-02-02 20:03:26 -0500
commitd841fc969a3a300ebeaa4279320235f2ff2b0533 (patch)
treed038b55c8ed79309ce408ad243065524009fa3b7 /src/key.h
parentc1c6de6ad4f92c6628dccc271fe4c661e450d130 (diff)
downloadbitcoin-d841fc969a3a300ebeaa4279320235f2ff2b0533.tar.xz
Full checking of all loaded keys
Diffstat (limited to 'src/key.h')
-rw-r--r--src/key.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/key.h b/src/key.h
index d2e6689456..0d0b6d8bb4 100644
--- a/src/key.h
+++ b/src/key.h
@@ -233,6 +233,17 @@ public:
{
return CBitcoinAddress(GetPubKey());
}
+
+ bool IsValid()
+ {
+ if (!fSet)
+ return false;
+
+ CSecret secret = GetSecret();
+ CKey key2;
+ key2.SetSecret(secret);
+ return GetPubKey() == key2.GetPubKey();
+ }
};
#endif