mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-25 15:05:55 +01:00
Merge #8381: Make witness v0 outputs non-standard
c59c434qa: Add test for standardness of segwit v0 outputs (Suhas Daftuar)1ffaff2Make witness v0 outputs non-standard before segwit activation (Johnson Lau)
This commit is contained in:
@@ -1143,13 +1143,14 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState& state, const C
|
||||
}
|
||||
|
||||
// Reject transactions with witness before segregated witness activates (override with -prematurewitness)
|
||||
if (!GetBoolArg("-prematurewitness",false) && !tx.wit.IsNull() && !IsWitnessEnabled(chainActive.Tip(), Params().GetConsensus())) {
|
||||
bool witnessEnabled = IsWitnessEnabled(chainActive.Tip(), Params().GetConsensus());
|
||||
if (!GetBoolArg("-prematurewitness",false) && !tx.wit.IsNull() && !witnessEnabled) {
|
||||
return state.DoS(0, false, REJECT_NONSTANDARD, "no-witness-yet", true);
|
||||
}
|
||||
|
||||
// Rather not work on nonstandard transactions (unless -testnet/-regtest)
|
||||
string reason;
|
||||
if (fRequireStandard && !IsStandardTx(tx, reason))
|
||||
if (fRequireStandard && !IsStandardTx(tx, reason, witnessEnabled))
|
||||
return state.DoS(0, false, REJECT_NONSTANDARD, reason);
|
||||
|
||||
// Only accept nLockTime-using transactions that can be mined in the next
|
||||
|
||||
Reference in New Issue
Block a user