31 #ifndef LEDGER_CORE_NETWORKS_HPP 32 #define LEDGER_CORE_NETWORKS_HPP 34 #ifndef LIBCORE_EXPORT 36 #include <libcore_export.h> 38 #define LIBCORE_EXPORT 42 #include "../../api/BitcoinLikeNetworkParameters.hpp" 49 enum sigHashType : uint8_t {
52 SIGHASH_SINGLE = 0x03,
53 SIGHASH_FORKID = 0x40,
54 SIGHASH_ANYONECANPAY = 0x80
58 static const int HIGHTEST_PARAMETERS_VERSION = 2;
60 extern LIBCORE_EXPORT
const api::BitcoinLikeNetworkParameters getNetworkParameters(
const std::string &networkName,
int version = HIGHTEST_PARAMETERS_VERSION);
65 template <
int migration>
66 void migrateParameters(api::BitcoinLikeNetworkParameters ¶ms) {
70 void migrateParameters(api::BitcoinLikeNetworkParameters ¶ms,
int migration);
72 static bool migrateParameters(api::BitcoinLikeNetworkParameters ¶ms,
75 if (targetVersion < 2 || currentVersion < 1) {
78 auto previous = migrateParameters(params, currentVersion, targetVersion - 1);
79 if (currentVersion < targetVersion) {
80 migrateParameters(params, targetVersion);
86 extern LIBCORE_EXPORT
const std::vector<api::BitcoinLikeNetworkParameters> ALL;
90 std::string blockHash;
91 std::vector<uint8_t> blockHeight;
98 std::vector<uint8_t> overwinterFlag;
99 std::vector<uint8_t> versionGroupId;
100 uint64_t blockHeight;
103 extern LIBCORE_EXPORT
const ZIPParameters ZIP_SAPLING_PARAMETERS;
104 template<
class Archive>
105 void serialize(Archive & archive,
128 #endif //LEDGER_CORE_NETWORKS_HPP std::vector< uint8_t > P2SHVersion
Definition: BitcoinLikeNetworkParameters.hpp:23
std::string MessagePrefix
Definition: BitcoinLikeNetworkParameters.hpp:31
Definition: networks.hpp:89
std::vector< uint8_t > SigHash
Definition: BitcoinLikeNetworkParameters.hpp:37
std::vector< uint8_t > XPUBVersion
Definition: BitcoinLikeNetworkParameters.hpp:25
std::vector< std::string > AdditionalBIPs
Definition: BitcoinLikeNetworkParameters.hpp:39
std::string Identifier
Definition: BitcoinLikeNetworkParameters.hpp:19
int64_t DustAmount
Definition: BitcoinLikeNetworkParameters.hpp:29
std::vector< uint8_t > P2PKHVersion
Definition: BitcoinLikeNetworkParameters.hpp:21
Definition: Account.cpp:8
BitcoinLikeFeePolicy FeePolicy
Definition: BitcoinLikeNetworkParameters.hpp:27
Definition: networks.hpp:96
bool UsesTimestampedTransaction
Definition: BitcoinLikeNetworkParameters.hpp:33
int64_t TimestampDelay
Definition: BitcoinLikeNetworkParameters.hpp:35
Definition: BitcoinLikeNetworkParameters.hpp:17