upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbitflash-maintainer <noreply@bitflash.invalid>2026-09-02 14:33:56 +0000
committerbitflash-maintainer <noreply@bitflash.invalid>2026-09-02 14:33:56 +0000
commit0b7363211f954698e593699f32ed13b425fce2bc (patch)
treed6571a09b702f98aeee84471aca9b9b310026b0c /src
parent03a69ccfb36861948e11b0871bb9af8f0b280709 (diff)
genesis: say that the 2025 nTime is known and must not be "fixed"
nTime is 1753315200, which is 2025-07-24T00:00:00Z. The comment beside it claimed 2026-07-24, and the headline in pszTimestamp reads 24/Jul/2026, so the constant looked like a typo somebody ought to correct. Nothing is wrong with the data. nTime matters only as an input to the genesis hash, the block hashes to hashGenesisBlock with it, the asserts pass, and the whole network agrees. The hazard is entirely in acting on the mismatch. Editing nTime alone trips the assert -- loud, and it reverts. Editing it and regenerating GENESIS_NONCE and hashGenesisBlock to match is the quiet one: that node starts without complaint, builds its own chain from height 0, and rejects every real peer, and the re-mining branch a few lines below prints exactly the constants needed to do it. So: correct the comment rather than the constant, state the discrepancy as known and uncorrectable, and have the re-mining printout say what those constants are and are not for. No value changes -- pszTimestamp, the scriptPubKey, nTime, nBits, nNonce, GENESIS_NONCE, hashGenesisBlock and hashGenesisMerkleRoot are all byte-identical.
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp27
1 files changed, 25 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 7b3e555..a68e3b0 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -2678,7 +2678,18 @@ bool LoadBlockIndex(bool fAllowNew)
2678 // CTxOut(nValue=50.00000000, scriptPubKey=0x5F1DF16B2B704C8A578D0B) 2678 // CTxOut(nValue=50.00000000, scriptPubKey=0x5F1DF16B2B704C8A578D0B)
2679 // vMerkleTree: 4a5e1e 2679 // vMerkleTree: 4a5e1e
2680 2680
2681 // Bitflash genesis block -- own header (fair launch, 2026 stable relaunch) 2681 // Bitflash genesis block -- own header (fair launch)
2682 //
2683 // Do not change pszTimestamp, the scriptPubKey, nTime or nNonce. They
2684 // are the inputs to the genesis hash, and the genesis hash is
2685 // consensus. Changing one on its own trips the assert below, which is
2686 // loud and reverts cleanly; changing one and regenerating
2687 // GENESIS_NONCE and hashGenesisBlock to match -- which is exactly what
2688 // the re-mining branch below prints out and invites -- gives a node
2689 // that starts without complaint, builds its own chain from height 0,
2690 // and rejects every real peer as being on a different chain. That one
2691 // fails silently, and the damage scales with how many people run the
2692 // "fixed" build.
2682 char* pszTimestamp = "Bitflash 24/Jul/2026 Fair launch: one CPU one vote, no premine"; 2693 char* pszTimestamp = "Bitflash 24/Jul/2026 Fair launch: one CPU one vote, no premine";
2683 CTransaction txNew; 2694 CTransaction txNew;
2684 txNew.vin.resize(1); 2695 txNew.vin.resize(1);
@@ -2691,7 +2702,14 @@ bool LoadBlockIndex(bool fAllowNew)
2691 block.hashPrevBlock = 0; 2702 block.hashPrevBlock = 0;
2692 block.hashMerkleRoot = block.BuildMerkleTree(); 2703 block.hashMerkleRoot = block.BuildMerkleTree();
2693 block.nVersion = 1; 2704 block.nVersion = 1;
2694 block.nTime = 1753315200; // 2026-07-24 00:00:00 UTC (stable relaunch) 2705 // 1753315200 is 2025-07-24T00:00:00Z. The headline in pszTimestamp
2706 // above reads 2026 and does not match it. This is a known discrepancy
2707 // and not a typo in the constant: the value is only consensus-critical
2708 // as an input to the genesis hash, the block hashes to
2709 // hashGenesisBlock with it, and every node on the network agrees. The
2710 // mismatch is in the launched chain and cannot be corrected -- see the
2711 // warning above before deciding otherwise.
2712 block.nTime = 1753315200;
2695 block.nBits = 0x1f0fffff; // = bnProofOfWorkLimit (Bitflash RandomX floor) 2713 block.nBits = 0x1f0fffff; // = bnProofOfWorkLimit (Bitflash RandomX floor)
2696 block.nNonce = GENESIS_NONCE; 2714 block.nNonce = GENESIS_NONCE;
2697 2715
@@ -2718,6 +2736,11 @@ bool LoadBlockIndex(bool fAllowNew)
2718 printf("powhash = %s\n", block.GetPoWHash().ToString().c_str()); 2736 printf("powhash = %s\n", block.GetPoWHash().ToString().c_str());
2719 printf("hash = %s\n", block.GetHash().ToString().c_str()); 2737 printf("hash = %s\n", block.GetHash().ToString().c_str());
2720 printf("merkle = %s\n", block.hashMerkleRoot.ToString().c_str()); 2738 printf("merkle = %s\n", block.hashMerkleRoot.ToString().c_str());
2739 printf("----------------------------------------\n");
2740 printf("These constants bring up a NEW chain. Do not paste them\n");
2741 printf("into a build for this network to make an edited nTime or\n");
2742 printf("pszTimestamp fit -- a node whose genesis differs starts\n");
2743 printf("cleanly on a chain of its own and rejects every real peer.\n");
2721 printf("========================================\n"); 2744 printf("========================================\n");
2722 } 2745 }
2723 2746