Skip to content

Commit 79b1e50

Browse files
committed
Refactor: implement CPubKey::data()
1 parent 614d26c commit 79b1e50

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/pubkey.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ class CPubKey
106106

107107
//! Simple read-only vector-like interface to the pubkey data.
108108
unsigned int size() const { return GetLen(vch[0]); }
109+
const unsigned char* data() const { return vch; }
109110
const unsigned char* begin() const { return vch; }
110111
const unsigned char* end() const { return vch + size(); }
111112
const unsigned char& operator[](unsigned int pos) const { return vch[pos]; }

src/script/sigcache.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class CSignatureCache
3939
void
4040
ComputeEntry(uint256& entry, const uint256 &hash, const std::vector<unsigned char>& vchSig, const CPubKey& pubkey)
4141
{
42-
CSHA256().Write(nonce.begin(), 32).Write(hash.begin(), 32).Write(&pubkey[0], pubkey.size()).Write(vchSig.data(), vchSig.size()).Finalize(entry.begin());
42+
CSHA256().Write(nonce.begin(), 32).Write(hash.begin(), 32).Write(pubkey.data(), pubkey.size()).Write(vchSig.data(), vchSig.size()).Finalize(entry.begin());
4343
}
4444

4545
bool

0 commit comments

Comments
 (0)