aboutsummaryrefslogtreecommitdiff
path: root/src/policy
diff options
context:
space:
mode:
authorGreg Sanders <gsanders87@gmail.com>2023-11-03 09:21:48 -0400
committerGreg Sanders <gsanders87@gmail.com>2024-07-30 14:06:58 -0400
commit9d892099378b2ad5f52220403bdeae43c61d6955 (patch)
tree868b8111278384d2ea24a31cf84a891e4e5d94a9 /src/policy
parentb60aaf8b239978947d2b0e3f56e7d8a4092d7570 (diff)
downloadbitcoin-9d892099378b2ad5f52220403bdeae43c61d6955.tar.xz
policy: stop 3rd party wtxid malleability of anchor spend
Diffstat (limited to 'src/policy')
-rw-r--r--src/policy/policy.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/policy/policy.cpp b/src/policy/policy.cpp
index e84a8428bf..68d879b5b8 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 <std::vector<unsigned char> > stack;