diff --git a/src/chainparams.cpp b/src/chainparams.cpp --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -199,7 +199,7 @@ base58Prefixes[SECRET_KEY] = std::vector(1, 128); base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x88, 0xB2, 0x1E}; base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x88, 0xAD, 0xE4}; - cashaddrPrefix = "bitcoincash"; + cashaddrPrefix = CASHADDR_PREFIX; vFixedSeeds = std::vector( pnSeed6_main, pnSeed6_main + ARRAYLEN(pnSeed6_main)); @@ -343,7 +343,7 @@ base58Prefixes[SECRET_KEY] = std::vector(1, 239); base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x35, 0x87, 0xCF}; base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x35, 0x83, 0x94}; - cashaddrPrefix = "bchtest"; + cashaddrPrefix = CASHADDR_PREFIX_TESTNET; vFixedSeeds = std::vector( pnSeed6_test, pnSeed6_test + ARRAYLEN(pnSeed6_test)); @@ -471,7 +471,7 @@ base58Prefixes[SECRET_KEY] = std::vector(1, 239); base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x35, 0x87, 0xCF}; base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x35, 0x83, 0x94}; - cashaddrPrefix = "bchreg"; + cashaddrPrefix = CASHADDR_PREFIX_REGTEST; } }; diff --git a/src/network.h b/src/network.h --- a/src/network.h +++ b/src/network.h @@ -10,5 +10,8 @@ extern const std::string NETWORK_NAME; extern const std::string CURRENCY_UNIT; extern const bool ENABLE_MINER_FUND; +extern const std::string CASHADDR_PREFIX; +extern const std::string CASHADDR_PREFIX_TESTNET; +extern const std::string CASHADDR_PREFIX_REGTEST; #endif // BITCOIN_NETWORK_H diff --git a/src/networks/abc/network.cpp b/src/networks/abc/network.cpp --- a/src/networks/abc/network.cpp +++ b/src/networks/abc/network.cpp @@ -7,3 +7,7 @@ const std::string NETWORK_NAME = "ABC"; const std::string CURRENCY_UNIT = "BCHA"; const bool ENABLE_MINER_FUND = true; + +const std::string CASHADDR_PREFIX = "abc"; +const std::string CASHADDR_PREFIX_TESTNET = "abctest"; +const std::string CASHADDR_PREFIX_REGTEST = "abcreg"; \ No newline at end of file diff --git a/src/networks/bchn/network.cpp b/src/networks/bchn/network.cpp --- a/src/networks/bchn/network.cpp +++ b/src/networks/bchn/network.cpp @@ -7,3 +7,7 @@ const std::string NETWORK_NAME = "Bitcoin Cash Node"; const std::string CURRENCY_UNIT = "BCHN"; const bool ENABLE_MINER_FUND = false; + +const std::string CASHADDR_PREFIX = "bitcoincash"; +const std::string CASHADDR_PREFIX_TESTNET = "bchtest"; +const std::string CASHADDR_PREFIX_REGTEST = "bchreg"; \ No newline at end of file