File tree 3 files changed +20
-1
lines changed
3 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -105,10 +105,12 @@ class CChainParams
105
105
uint64_t PruneAfterHeight () const { return nPruneAfterHeight; }
106
106
/* * Minimum free space (in GB) needed for data directory */
107
107
uint64_t AssumedBlockchainSize () const { return m_assumed_blockchain_size; }
108
- /* * Minimum free space (in GB) needed for data directory when pruned; Does not include prune target*/
108
+ /* * Minimum free space (in GB) needed for data directory when pruned; Does not include prune target */
109
109
uint64_t AssumedChainStateSize () const { return m_assumed_chain_state_size; }
110
110
/* * Whether it is possible to mine blocks on demand (no retargeting) */
111
111
bool MineBlocksOnDemand () const { return consensus.fPowNoRetargeting ; }
112
+ /* * Return the chain type as a user-facing string */
113
+ std::string GetChainTypeDisplayString () const { return ChainTypeToDisplayString (m_chain_type); }
112
114
/* * Return the chain type string */
113
115
std::string GetChainTypeString () const { return ChainTypeToString (m_chain_type); }
114
116
/* * Return the chain type */
Original file line number Diff line number Diff line change @@ -41,3 +41,18 @@ std::optional<ChainType> ChainTypeFromString(std::string_view chain)
41
41
return std::nullopt;
42
42
}
43
43
}
44
+
45
+ std::string ChainTypeToDisplayString (ChainType chain)
46
+ {
47
+ switch (chain) {
48
+ case ChainType::MAIN:
49
+ return " Bitcoin" ;
50
+ case ChainType::TESTNET:
51
+ return " testnet" ;
52
+ case ChainType::SIGNET:
53
+ return " signet" ;
54
+ case ChainType::REGTEST:
55
+ return " regtest" ;
56
+ }
57
+ assert (false );
58
+ }
Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ enum class ChainType {
16
16
TESTNET4,
17
17
};
18
18
19
+ std::string ChainTypeToDisplayString (ChainType chain);
20
+
19
21
std::string ChainTypeToString (ChainType chain);
20
22
21
23
std::optional<ChainType> ChainTypeFromString (std::string_view chain);
You can’t perform that action at this time.
0 commit comments