diff options
author | MarcoFalke <falke.marco@gmail.com> | 2018-07-22 09:09:04 -0400 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2018-07-22 09:09:07 -0400 |
commit | 59407fce54faa35d3e2429f712e9b7af51f5aa9b (patch) | |
tree | 2c0fd87fe5ef4089a4c1701577d7df4294bed951 | |
parent | aa9429a197328d4785a8cbf8e7535b608f653426 (diff) | |
parent | 67555698405f7b8cc51e23227830bf91a2fb9d78 (diff) |
Merge #13722: trivial: Replace CPubKey::operator[] with CPubKey::vch where possible
6755569840 trivial: Replace CPubKey::operator[] with CPubKey::vch where possible (Nikolay Mitev)
Pull request description:
Use variable name instead of calling operator[] through &(*this)[0]
Tree-SHA512: 7054ffda0fa33fb45d4d9f3b29698643f02fd1421d78d5197a0881f2c368dc410647fd2e1a6feb8048e30f8ab8bc2fa8749bf42b9ccbe42c30de8ff80ac45274
-rw-r--r-- | src/pubkey.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/pubkey.cpp b/src/pubkey.cpp index 6e601a6f13..1eb126434b 100644 --- a/src/pubkey.cpp +++ b/src/pubkey.cpp @@ -171,7 +171,7 @@ bool CPubKey::Verify(const uint256 &hash, const std::vector<unsigned char>& vchS return false; secp256k1_pubkey pubkey; secp256k1_ecdsa_signature sig; - if (!secp256k1_ec_pubkey_parse(secp256k1_context_verify, &pubkey, &(*this)[0], size())) { + if (!secp256k1_ec_pubkey_parse(secp256k1_context_verify, &pubkey, vch, size())) { return false; } if (!ecdsa_signature_parse_der_lax(secp256k1_context_verify, &sig, vchSig.data(), vchSig.size())) { @@ -207,14 +207,14 @@ bool CPubKey::IsFullyValid() const { if (!IsValid()) return false; secp256k1_pubkey pubkey; - return secp256k1_ec_pubkey_parse(secp256k1_context_verify, &pubkey, &(*this)[0], size()); + return secp256k1_ec_pubkey_parse(secp256k1_context_verify, &pubkey, vch, size()); } bool CPubKey::Decompress() { if (!IsValid()) return false; secp256k1_pubkey pubkey; - if (!secp256k1_ec_pubkey_parse(secp256k1_context_verify, &pubkey, &(*this)[0], size())) { + if (!secp256k1_ec_pubkey_parse(secp256k1_context_verify, &pubkey, vch, size())) { return false; } unsigned char pub[PUBLIC_KEY_SIZE]; @@ -232,7 +232,7 @@ bool CPubKey::Derive(CPubKey& pubkeyChild, ChainCode &ccChild, unsigned int nChi BIP32Hash(cc, nChild, *begin(), begin()+1, out); memcpy(ccChild.begin(), out+32, 32); secp256k1_pubkey pubkey; - if (!secp256k1_ec_pubkey_parse(secp256k1_context_verify, &pubkey, &(*this)[0], size())) { + if (!secp256k1_ec_pubkey_parse(secp256k1_context_verify, &pubkey, vch, size())) { return false; } if (!secp256k1_ec_pubkey_tweak_add(secp256k1_context_verify, &pubkey, out)) { |