From 9d892099378b2ad5f52220403bdeae43c61d6955 Mon Sep 17 00:00:00 2001 From: Greg Sanders Date: Fri, 3 Nov 2023 09:21:48 -0400 Subject: [PATCH] policy: stop 3rd party wtxid malleability of anchor spend --- src/policy/policy.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/policy/policy.cpp b/src/policy/policy.cpp index e84a8428bf2..68d879b5b81 100644 --- a/src/policy/policy.cpp +++ b/src/policy/policy.cpp @@ -225,6 +225,11 @@ bool IsWitnessStandard(const CTransaction& tx, const CCoinsViewCache& mapInputs) // get the scriptPubKey corresponding to this input: CScript prevScript = prev.scriptPubKey; + // witness stuffing detected + if (prevScript.IsPayToAnchor()) { + return false; + } + bool p2sh = false; if (prevScript.IsPayToScriptHash()) { std::vector > stack;