mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
Abstract chaincodes into CChainCode
# Conflicts: # src/key.cpp # src/key.h
This commit is contained in:
committed by
Jonas Schnelli
parent
90c37bc16c
commit
8cf1485f3b
@@ -6,6 +6,7 @@
|
||||
#ifndef BITCOIN_KEY_H
|
||||
#define BITCOIN_KEY_H
|
||||
|
||||
#include "pubkey.h"
|
||||
#include "serialize.h"
|
||||
#include "support/allocators/secure.h"
|
||||
#include "uint256.h"
|
||||
@@ -13,9 +14,6 @@
|
||||
#include <stdexcept>
|
||||
#include <vector>
|
||||
|
||||
class CPubKey;
|
||||
|
||||
struct CExtPubKey;
|
||||
|
||||
/**
|
||||
* secp256k1:
|
||||
@@ -157,13 +155,13 @@ struct CExtKey {
|
||||
unsigned char nDepth;
|
||||
unsigned char vchFingerprint[4];
|
||||
unsigned int nChild;
|
||||
unsigned char vchChainCode[32];
|
||||
CChainCode chaincode;
|
||||
CKey key;
|
||||
|
||||
friend bool operator==(const CExtKey& a, const CExtKey& 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.key == b.key;
|
||||
memcmp(&a.chaincode.data[0], &b.chaincode.data[0], 32) == 0 && a.key == b.key;
|
||||
}
|
||||
|
||||
void Encode(unsigned char code[74]) const;
|
||||
|
||||
Reference in New Issue
Block a user