aboutsummaryrefslogtreecommitdiff
path: root/src/pubkey.h
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2015-05-06 18:36:56 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2015-05-06 18:37:49 +0200
commit6a877e870e0237f66414d0229f1b5cb38c5ca06d (patch)
treeff457ac79a7a7a95c10f68f03fbf155a83465439 /src/pubkey.h
parent1fd2d39529b53fdf0a8451a1dd57ba8e51ddb77a (diff)
parenta574899671d428682b339ff988363ecaf7dfcd07 (diff)
downloadbitcoin-6a877e870e0237f66414d0229f1b5cb38c5ca06d.tar.xz
Merge pull request #6034
a574899 chaincodes: abstract away more chaincode behavior [squashme] replace struct CCainCode with a typedef uint256 ChainCode (Cory Fields) 8cf1485 Abstract chaincodes into CChainCode (Pieter Wuille)
Diffstat (limited to 'src/pubkey.h')
-rw-r--r--src/pubkey.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/pubkey.h b/src/pubkey.h
index b0768d4f47..cce9c826e5 100644
--- a/src/pubkey.h
+++ b/src/pubkey.h
@@ -31,6 +31,8 @@ public:
CKeyID(const uint160& in) : uint160(in) {}
};
+typedef uint256 ChainCode;
+
/** An encapsulated public key. */
class CPubKey
{
@@ -182,20 +184,20 @@ public:
bool Decompress();
//! Derive BIP32 child pubkey.
- bool Derive(CPubKey& pubkeyChild, unsigned char ccChild[32], unsigned int nChild, const unsigned char cc[32]) const;
+ bool Derive(CPubKey& pubkeyChild, ChainCode &ccChild, unsigned int nChild, const ChainCode& cc) const;
};
struct CExtPubKey {
unsigned char nDepth;
unsigned char vchFingerprint[4];
unsigned int nChild;
- unsigned char vchChainCode[32];
+ ChainCode chaincode;
CPubKey pubkey;
- friend bool operator==(const CExtPubKey& a, const CExtPubKey& b)
+ friend bool operator==(const CExtPubKey &a, const CExtPubKey &b)
{
return a.nDepth == b.nDepth && memcmp(&a.vchFingerprint[0], &b.vchFingerprint[0], 4) == 0 && a.nChild == b.nChild &&
- memcmp(&a.vchChainCode[0], &b.vchChainCode[0], 32) == 0 && a.pubkey == b.pubkey;
+ a.chaincode == b.chaincode && a.pubkey == b.pubkey;
}
void Encode(unsigned char code[74]) const;