From b4f1e4161cddfd5057f84dcbb12f9c864bcd35af Mon Sep 17 00:00:00 2001 From: pacificao Date: Wed, 18 Feb 2026 23:32:06 -0800 Subject: [PATCH] refactor --- src/chainparams.cpp | 9 ++++++++- src/kernel.cpp | 19 ------------------- 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 1e6cc1b5..a7850194 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -131,7 +131,14 @@ public: nMaxMoneyOut = 999999999999 * COIN; /** Height or Time Based Activations **/ - nLastPOWBlock = 100; + // + // Hybrid PoW/PoS schedule: + // - PoW is permitted for ~50 years (based on target spacing) + // - After that, the chain becomes PoS-only + // + // We use the Julian year (365.25 days) for a deterministic conversion. + static const int64_t JULIAN_YEAR_SECONDS = 31557600; // 365.25 * 24 * 60 * 60 + nLastPOWBlock = (int)((50LL * JULIAN_YEAR_SECONDS) / nTargetSpacing); // Hybrid consensus: PoW mining and PoS staking are both permitted beginning at block 2. // PoW remains permitted until nLastPOWBlock. diff --git a/src/kernel.cpp b/src/kernel.cpp index a46d3682..234bee07 100644 --- a/src/kernel.cpp +++ b/src/kernel.cpp @@ -131,25 +131,6 @@ static bool SelectBlockFromCandidates( LogPrintf("SelectBlockFromCandidates: selection hash=%s\n", hashBest.ToString().c_str()); return fSelected; } - // the selection hash is divided by 2**32 so that proof-of-stake block - // is always favored over proof-of-work block. this is to preserve - // the energy efficiency property - if (pindex->IsProofOfStake()) - hashSelection >>= 32; - - if (fSelected && hashSelection < hashBest) { - hashBest = hashSelection; - *pindexSelected = (const CBlockIndex*)pindex; - } else if (!fSelected) { - fSelected = true; - hashBest = hashSelection; - *pindexSelected = (const CBlockIndex*)pindex; - } - } - if (GetBoolArg("-printstakemodifier", false)) - LogPrintf("SelectBlockFromCandidates: selection hash=%s\n", hashBest.ToString().c_str()); - return fSelected; -} // Stake Modifier (hash modifier of proof-of-stake): // The purpose of stake modifier is to prevent a txout (coin) owner from