5 #ifndef PIVX_WALLET_HDCHAIN_H
6 #define PIVX_WALLET_HDCHAIN_H
12 static const uint8_t EXTERNAL = 0;
13 static const uint8_t INTERNAL = 1;
14 static const uint8_t STAKING = 2;
17 namespace ChainCounterType {
19 static const uint8_t Sapling = 1;
38 uint8_t
chainType{HDChain::ChainCounterType::Standard};
44 READWRITE(obj.nVersion, obj.seed_id, obj.nExternalChainCounter, obj.nInternalChainCounter, obj.nStakingChainCounter);
45 if (obj.nVersion > 1)
READWRITE(obj.chainType);
56 case HDChain::ChangeType::EXTERNAL:
58 case HDChain::ChangeType::INTERNAL:
60 case HDChain::ChangeType::STAKING:
63 throw std::runtime_error(
"HD chain type doesn't exist.");
CHDChain(const uint8_t &_chainType=HDChain::ChainCounterType::Standard)
SERIALIZE_METHODS(CHDChain, obj)
bool SetSeed(const CKeyID &seedId)
uint32_t nInternalChainCounter
uint32_t nStakingChainCounter
static const int CURRENT_VERSION
uint32_t & GetChainCounter(const uint8_t &type=HDChain::ChangeType::EXTERNAL)
uint32_t nExternalChainCounter
A reference to a CKey: the Hash160 of its serialized public key.
ChangeType
General change type (added, updated, removed).