aboutsummaryrefslogtreecommitdiff
path: root/src/key.cpp
diff options
context:
space:
mode:
authorpatrick s <patrick.strateman@gmail.com>2013-08-29 01:11:47 -0700
committerpatrick s <patrick.strateman@gmail.com>2013-08-29 01:11:47 -0700
commita42eef6f10e1da1c76e1c9ba49a2ff2459c62fea (patch)
tree22fe8dc0fdcf81e4af3050f5c1143f4f45dbbdfb /src/key.cpp
parent6e51b3bddf782f53527cf968445b298ebdec9bbc (diff)
verify vchPubKey matches calculated public key unless fSkipCheck is set
Diffstat (limited to 'src/key.cpp')
-rw-r--r--src/key.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/key.cpp b/src/key.cpp
index 0377140f79..fe5222378a 100644
--- a/src/key.cpp
+++ b/src/key.cpp
@@ -421,6 +421,12 @@ bool CKey::Load(CPrivKey &privkey, CPubKey &vchPubKey, bool fSkipCheck=false) {
fCompressed = vchPubKey.IsCompressed();
fValid = true;
+ if (fSkipCheck)
+ return true;
+
+ if (GetPubKey() != vchPubKey)
+ return false;
+
return true;
}