There’s nothing wrong with not repeating yourself either (or I’ve failed to
understand what is wrong with it. I think that the fact that testnet and
regtest is what is historical and there’s no need to have different
prefixes with each chain. In fact, as said, it doesn’t scale. For example,
I’m creating N new chains for sizetest, should they have different
prefixes? IMO either main or test prefixes are fine for it, there’s really
no good reason to ever introduce a third one (or I haven’t hear it yet).
On Jul 10, 2015 12:03 AM, “Pieter Wuille” notifications@github.com wrote:
In src/chainparams.cpp
#6381 (review):
- * database.
-
- * CBlock(hash=000000000019d6, ver=1, hashPrevBlock=00000000000000, hashMerkleRoot=4a5e1e, nTime=1231006505, nBits=1d00ffff, nNonce=2083236893, vtx=1)
- * CTransaction(hash=4a5e1e, ver=1, vin.size=1, vout.size=1, nLockTime=0)
- * CTxIn(COutPoint(000000, -1), coinbase 04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73)
- * CTxOut(nValue=50.00000000, scriptPubKey=0x5F1DF16B2B704C8A578D0B)
- * vMerkleTree: 4a5e1e
- */
+static CBlock CreateGenesisBlock(uint32_t nTime=1231006505, uint32_t nNonce=2083236893, uint32_t nBits=0x1d00ffff, int32_t nVersion=1, const CAmount& genesisReward=50 * COIN)
+{
- const char* pszTimestamp = “The Times 03/Jan/2009 Chancellor on brink of second bailout for banks”;
- CScript genesisOutputScript = CScript() « ParseHex(“04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f”) « OP_CHECKSIG;
- return CreateGenesisBlock(pszTimestamp, genesisOutputScript, nTime, nNonce, nBits, nVersion, genesisReward);
+}
+static void AssignBase58PrefixStyle(std::vector* base58Prefixes, Base58PrefixStyle base58PrefixStyle)
The fact that regtest and testnet use the same style addresses is
historical IMHO. There is nothing wrong with copying the values - they just
happen to have the values, for unrelated reasons. Maybe some day we want to
change the regtest ones without changing the testnet one.
—
Reply to this email directly or view it on GitHub
https://github.com/bitcoin/bitcoin/pull/6381/files#r34309159.