Skip to content

Commit 59407fc

Browse files
author
MarcoFalke
committed
Merge #13722: trivial: Replace CPubKey::operator[] with CPubKey::vch where possible
6755569 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
2 parents aa9429a + 6755569 commit 59407fc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/pubkey.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ bool CPubKey::Verify(const uint256 &hash, const std::vector<unsigned char>& vchS
171171
return false;
172172
secp256k1_pubkey pubkey;
173173
secp256k1_ecdsa_signature sig;
174-
if (!secp256k1_ec_pubkey_parse(secp256k1_context_verify, &pubkey, &(*this)[0], size())) {
174+
if (!secp256k1_ec_pubkey_parse(secp256k1_context_verify, &pubkey, vch, size())) {
175175
return false;
176176
}
177177
if (!ecdsa_signature_parse_der_lax(secp256k1_context_verify, &sig, vchSig.data(), vchSig.size())) {
@@ -207,14 +207,14 @@ bool CPubKey::IsFullyValid() const {
207207
if (!IsValid())
208208
return false;
209209
secp256k1_pubkey pubkey;
210-
return secp256k1_ec_pubkey_parse(secp256k1_context_verify, &pubkey, &(*this)[0], size());
210+
return secp256k1_ec_pubkey_parse(secp256k1_context_verify, &pubkey, vch, size());
211211
}
212212

213213
bool CPubKey::Decompress() {
214214
if (!IsValid())
215215
return false;
216216
secp256k1_pubkey pubkey;
217-
if (!secp256k1_ec_pubkey_parse(secp256k1_context_verify, &pubkey, &(*this)[0], size())) {
217+
if (!secp256k1_ec_pubkey_parse(secp256k1_context_verify, &pubkey, vch, size())) {
218218
return false;
219219
}
220220
unsigned char pub[PUBLIC_KEY_SIZE];
@@ -232,7 +232,7 @@ bool CPubKey::Derive(CPubKey& pubkeyChild, ChainCode &ccChild, unsigned int nChi
232232
BIP32Hash(cc, nChild, *begin(), begin()+1, out);
233233
memcpy(ccChild.begin(), out+32, 32);
234234
secp256k1_pubkey pubkey;
235-
if (!secp256k1_ec_pubkey_parse(secp256k1_context_verify, &pubkey, &(*this)[0], size())) {
235+
if (!secp256k1_ec_pubkey_parse(secp256k1_context_verify, &pubkey, vch, size())) {
236236
return false;
237237
}
238238
if (!secp256k1_ec_pubkey_tweak_add(secp256k1_context_verify, &pubkey, out)) {

0 commit comments

Comments
 (0)