PIVX Core  5.6.99
P2P Digital Currency
hdchain.cpp
Go to the documentation of this file.
1 // Copyright (c) 2020-2021 The PIVX Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #include "wallet/hdchain.h"
6 
7 #include "chainparams.h"
8 #include "key_io.h"
9 #include "tinyformat.h"
10 #include "util/system.h"
11 #include "utilstrencodings.h"
12 
14 {
16  seed_id = CKeyID();
20  return IsNull();
21 }
22 
23 bool CHDChain::IsNull() const
24 {
25  return seed_id.IsNull();
26 }
27 
28 bool CHDChain::SetSeed( const CKeyID& seedId)
29 {
30  // Cannot be initialized twice
31  if (!IsNull())
32  return false;
33 
34  seed_id = seedId;
35  return true;
36 }
bool SetSeed(const CKeyID &seedId)
Definition: hdchain.cpp:28
uint32_t nInternalChainCounter
Definition: hdchain.h:35
bool IsNull() const
Definition: hdchain.cpp:23
CKeyID seed_id
Definition: hdchain.h:28
uint32_t nStakingChainCounter
Definition: hdchain.h:36
int nVersion
Definition: hdchain.h:27
static const int CURRENT_VERSION
Definition: hdchain.h:32
bool SetNull()
Definition: hdchain.cpp:13
uint32_t nExternalChainCounter
Definition: hdchain.h:34
A reference to a CKey: the Hash160 of its serialized public key.
Definition: pubkey.h:21
bool IsNull() const
Definition: uint256.h:36