diff options
| author | Pieter Wuille <[email protected]> | 2014-11-06 01:17:48 -0800 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2014-11-23 10:47:39 +0100 |
| commit | d0c41a73501a0bf94fca91be5fb38ab039490843 (patch) | |
| tree | 46da9cfe49a652b7853fcb3d1fb4ba0e6c52a9d7 /src/wallet.cpp | |
| parent | Merge pull request #5350 (diff) | |
| download | discoin-d0c41a73501a0bf94fca91be5fb38ab039490843.tar.xz discoin-d0c41a73501a0bf94fca91be5fb38ab039490843.zip | |
Add sanity check after key generation
Add a sanity check to prevent cosmic rays from flipping a bit in the
generated public key, or bugs in the elliptic curve code. This is
simply done by signing a (randomized) message, and verifying the
result.
Diffstat (limited to 'src/wallet.cpp')
| -rw-r--r-- | src/wallet.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/wallet.cpp b/src/wallet.cpp index 5aea9881c..353010ae0 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -79,6 +79,7 @@ CPubKey CWallet::GenerateNewKey() SetMinVersion(FEATURE_COMPRPUBKEY); CPubKey pubkey = secret.GetPubKey(); + assert(secret.VerifyPubKey(pubkey)); // Create new metadata int64_t nCreationTime = GetTime(); |