From 08a4ccb6145075677764038b830b28abf694b83c Mon Sep 17 00:00:00 2001 From: Michel van Kessel Date: Sun, 21 Feb 2021 17:31:29 +0100 Subject: [PATCH 1/2] switch policy to (txout.IsDust(::minRelayTxFee)) --- src/policy/policy.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/policy/policy.cpp b/src/policy/policy.cpp index f448d4bd7..340235be2 100644 --- a/src/policy/policy.cpp +++ b/src/policy/policy.cpp @@ -108,7 +108,7 @@ bool IsStandardTx(const CTransaction& tx, std::string& reason) if (whichType == TX_NULL_DATA) nDataOut++; - else if (txout.nValue == 0) { + else if (txout.IsDust(::minRelayTxFee)) { reason = "dust"; return false; } @@ -119,7 +119,7 @@ bool IsStandardTx(const CTransaction& tx, std::string& reason) else if ((whichType == TX_MULTISIG) && (!fIsBareMultisigStd)) { reason = "bare-multisig"; return false; - } else if (txout.nValue == 0) { + } else if (txout.IsDust(::minRelayTxFee)) { reason = "dust"; return false; } From 574f2ffd73dc2d79f5ea020f7896c4abf6f3272a Mon Sep 17 00:00:00 2001 From: Michel van Kessel Date: Tue, 23 Feb 2021 16:28:28 +0100 Subject: [PATCH 2/2] ban clients with forked chains --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index cd785724c..b61f18bbc 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3653,7 +3653,7 @@ bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& sta int nHeight = pindexPrev->nHeight+1; if (chainActive.Height() - nHeight >= consensusParams.nMaxReorganizationDepth) - return state.DoS(1, error("%s: forked chain older than max reorganization depth (height %d)", __func__, nHeight)); + return state.DoS(100, error("%s: forked chain older than max reorganization depth (height %d)", __func__, nHeight)); // Preliminary check difficulty in pos-only stage if (chainActive.Height() > consensusParams.nLastPOWBlock && nHeight > consensusParams.nLastPOWBlock && block.nBits != GetNextTargetRequired(pindexPrev, &block, consensusParams, true))