Skip to content

Conversation

@sdaftuar
Copy link
Member

@sdaftuar sdaftuar commented Aug 7, 2020

Backport of #19620 to 0.20.

sdaftuar and others added 2 commits August 7, 2020 12:44
Our policy checks for non-standard inputs depend only on the non-witness
portion of a transaction: we look up the scriptPubKey of the input being
spent from our UTXO set (which is covered by the input txid), and the p2sh
checks only rely on the scriptSig portion of the input.

Consequently it's safe to add txids of transactions that fail these checks to
the reject filter, as the witness is irrelevant to the failure. This is helpful
for any situation where we might request the transaction again via txid (either
from txid-relay peers, or if we might fetch the transaction via txid due to
parent-fetching of orphans).

Further, in preparation for future witness versions being deployed on the
network, ensure that WITNESS_UNKNOWN transactions are rejected in
AreInputsStandard(), so that transactions spending v1 (or greater) witness
outputs will fall into this category of having their txid added to the reject
filter.

Github-Pull: bitcoin#19620
Rebased-From: 7989901
@sdaftuar sdaftuar force-pushed the 2020-08-reject-unknown-wit-0.20 branch from 650cad9 to 107cf15 Compare August 7, 2020 16:45
@jnewbery
Copy link
Contributor

utACK 107cf15

@instagibbs
Copy link
Member

should this be added to 0.20.2 milestone?

@instagibbs
Copy link
Member

utACK 107cf15

@maflcko maflcko added this to the 0.20.2 milestone Aug 24, 2020
@fjahr
Copy link
Contributor

fjahr commented Sep 1, 2020

utACK 107cf15

Didn't do full testing but briefly verified that the test fails if the behavior changes are undone.

@fanquake fanquake merged commit 3092699 into bitcoin:0.20 Sep 4, 2020
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Feb 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants