From f5fbfdefd50c32264aa6d4cde0b02dab115e8382 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 24 Jan 2018 16:26:54 +0100 Subject: [PATCH] Merge #12250: Make CKey::Load references const 04ededf Make CKey::Load references const (Russell Yanofsky) Pull request description: No change in behavior, this just prevents CKey::Load arguments from looking like outputs. Tree-SHA512: 6d93bce109318e88ddd5c21ad626571344707ae0e6d46e898c76fd95a7afd1c32202a6b3dfab47d6a787c84dfcbb35343cdec898bcf8f668574aa224f2eed977 --- src/key.cpp | 2 +- src/key.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/key.cpp b/src/key.cpp index d0b848843c..5902829ea6 100644 --- a/src/key.cpp +++ b/src/key.cpp @@ -201,7 +201,7 @@ bool CKey::SignCompact(const uint256 &hash, std::vector& vchSig) return true; } -bool CKey::Load(CPrivKey &privkey, CPubKey &vchPubKey, bool fSkipCheck=false) { +bool CKey::Load(const CPrivKey &privkey, const CPubKey &vchPubKey, bool fSkipCheck=false) { if (!ec_privkey_import_der(secp256k1_context_sign, (unsigned char*)begin(), privkey.data(), privkey.size())) return false; fCompressed = vchPubKey.IsCompressed(); diff --git a/src/key.h b/src/key.h index ff9ccddc36..c4c5e1590c 100644 --- a/src/key.h +++ b/src/key.h @@ -129,7 +129,7 @@ public: bool VerifyPubKey(const CPubKey& vchPubKey) const; //! Load private key and check that public key matches. - bool Load(CPrivKey& privkey, CPubKey& vchPubKey, bool fSkipCheck); + bool Load(const CPrivKey& privkey, const CPubKey& vchPubKey, bool fSkipCheck); }; struct CExtKey {