diff options
| author | Ross Nicoll <[email protected]> | 2018-01-20 16:39:49 +0000 |
|---|---|---|
| committer | Ross Nicoll <[email protected]> | 2018-09-19 22:11:47 +0100 |
| commit | 2860c4bc31188b7644429b0475abfb4f400224cf (patch) | |
| tree | 6c968948ebd5668d61d0e22a452c48727ed2470c /src/validation.cpp | |
| parent | Update test cases at 1000-byte boundaries (#1439) (diff) | |
| download | discoin-2860c4bc31188b7644429b0475abfb4f400224cf.tar.xz discoin-2860c4bc31188b7644429b0475abfb4f400224cf.zip | |
Enforce minor Dogecoin parameters (#1427)
* Minimum number of blocks and blockchain size are increased for pruning. In comparison to Bitcoin this uses 24 hours as a minimum, rather than 48, although given blocks are rarely full this likely reflects a lot longer in reality.
* Multiply fork detection parameters by 5. The wall clock time elapsed for "long" forks is therefore half that of Bitcoin, but IMHO those figures are excessive for a chain with 1 minute block times.
* BIP16 and BIP30 have both been enabled on Dogecoin since inception and should not be conditional.
Diffstat (limited to 'src/validation.cpp')
| -rw-r--r-- | src/validation.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/validation.cpp b/src/validation.cpp index 240edafda..1f29a9b6b 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -1255,12 +1255,12 @@ void CheckForkWarningConditions() if (IsInitialBlockDownload()) return; - // If our best fork is no longer within 72 blocks (+/- 12 hours if no one mines it) + // If our best fork is no longer within 360 blocks (+/- 6 hours if no one mines it) // of our head, drop it - if (pindexBestForkTip && chainActive.Height() - pindexBestForkTip->nHeight >= 72) + if (pindexBestForkTip && chainActive.Height() - pindexBestForkTip->nHeight >= 360) pindexBestForkTip = NULL; - if (pindexBestForkTip || (pindexBestInvalid && pindexBestInvalid->nChainWork > chainActive.Tip()->nChainWork + (GetBlockProof(*chainActive.Tip()) * 6))) + if (pindexBestForkTip || (pindexBestInvalid && pindexBestInvalid->nChainWork > chainActive.Tip()->nChainWork + (GetBlockProof(*chainActive.Tip()) * 30))) { if (!GetfLargeWorkForkFound() && pindexBestForkBase) { @@ -1829,9 +1829,8 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin // Now that the whole chain is irreversibly beyond that time it is applied to all blocks except the // two in the chain that violate it. This prevents exploiting the issue against nodes during their // initial block download. - bool fEnforceBIP30 = (!pindex->phashBlock) || // Enforce on CreateNewBlock invocations which don't have a hash. - !((pindex->nHeight==91842 && pindex->GetBlockHash() == uint256S("0x00000000000a4d0a398161ffc163c503763b1f4360639393e0e4c8e300e0caec")) || - (pindex->nHeight==91880 && pindex->GetBlockHash() == uint256S("0x00000000000743f190a18c5577a3c2d2a1f610ae9601ac046a38084ccb7cd721"))); + // Dogecoin: BIP30 has been active since inception + bool fEnforceBIP30 = true; // Once BIP34 activated it was not possible to create new duplicate coinbases and thus other than starting // with the 2 existing duplicate coinbase pairs, not possible to create overwriting txs. But by the @@ -1853,8 +1852,8 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin } // BIP16 didn't become active until Apr 1 2012 - int64_t nBIP16SwitchTime = 1333238400; - bool fStrictPayToScriptHash = (pindex->GetBlockTime() >= nBIP16SwitchTime); + // Dogecoin: BIP16 has been enabled since inception + bool fStrictPayToScriptHash = true; unsigned int flags = fStrictPayToScriptHash ? SCRIPT_VERIFY_P2SH : SCRIPT_VERIFY_NONE; |