Skip to content

Commit

Permalink
fix SCRIPT_ADDRESS
Browse files Browse the repository at this point in the history
Deprecate the old p2sh-segwit address prefix.
  • Loading branch information
fujicoin committed Mar 30, 2023
1 parent 248a793 commit b6420da
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 14 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
AC_PREREQ([2.69])
define(_CLIENT_VERSION_MAJOR, 24)
define(_CLIENT_VERSION_MINOR, 0)
define(_CLIENT_VERSION_BUILD, 2)
define(_CLIENT_VERSION_BUILD, 3)
define(_CLIENT_VERSION_RC, 0)
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2023)
Expand Down
18 changes: 7 additions & 11 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,7 @@ class CMainParams : public CChainParams {
vSeeds.emplace_back("dnsseed.tamami-foundation.org");

base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,50); // M
base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,5);
base58Prefixes[SCRIPT_ADDRESS2] = std::vector<unsigned char>(1,55); // P
base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,55); // P
base58Prefixes[SECRET_KEY] = std::vector<unsigned char>(1,176);
base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x88, 0xB2, 0x1E};
base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x88, 0xAD, 0xE4};
Expand Down Expand Up @@ -242,9 +241,8 @@ class CTestNetParams : public CChainParams {
vSeeds.emplace_back("testnet-dnsseed.monacoin.org");
vSeeds.emplace_back("testnet-dnsseed.tamami-foundation.org");

base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,111);
base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,196);
base58Prefixes[SCRIPT_ADDRESS2] = std::vector<unsigned char>(1,117);
base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,111); // m or n
base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,117); // p
base58Prefixes[SECRET_KEY] = std::vector<unsigned char>(1,239);
base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x35, 0x87, 0xCF};
base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x35, 0x83, 0x94};
Expand Down Expand Up @@ -376,9 +374,8 @@ class SigNetParams : public CChainParams {

vFixedSeeds.clear();

base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,111);
base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,196);
base58Prefixes[SCRIPT_ADDRESS2] = std::vector<unsigned char>(1,117);
base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,111); // m or n
base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,117); // p
base58Prefixes[SECRET_KEY] = std::vector<unsigned char>(1,239);
base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x35, 0x87, 0xCF};
base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x35, 0x83, 0x94};
Expand Down Expand Up @@ -478,9 +475,8 @@ class CRegTestParams : public CChainParams {
0
};

base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,111);
base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,196);
base58Prefixes[SCRIPT_ADDRESS2] = std::vector<unsigned char>(1,117);
base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,111); // m or n
base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,117); // p
base58Prefixes[SECRET_KEY] = std::vector<unsigned char>(1,239);
base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x35, 0x87, 0xCF};
base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x35, 0x83, 0x94};
Expand Down
1 change: 0 additions & 1 deletion src/chainparams.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ class CChainParams
enum Base58Type {
PUBKEY_ADDRESS,
SCRIPT_ADDRESS,
SCRIPT_ADDRESS2,
SECRET_KEY,
EXT_PUBLIC_KEY,
EXT_SECRET_KEY,
Expand Down
2 changes: 1 addition & 1 deletion src/key_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class DestinationEncoder

std::string operator()(const ScriptHash& id) const
{
std::vector<unsigned char> data = m_params.Base58Prefix(CChainParams::SCRIPT_ADDRESS2);
std::vector<unsigned char> data = m_params.Base58Prefix(CChainParams::SCRIPT_ADDRESS);
data.insert(data.end(), id.begin(), id.end());
return EncodeBase58Check(data);
}
Expand Down

0 comments on commit b6420da

Please sign in to comment.