mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 23:03:45 +01:00
Make witness v0 outputs non-standard before segwit activation
Github-Pull: #8381
Rebased-From: 1ffaff2f74
This commit is contained in:
committed by
Wladimir J. van der Laan
parent
86edc20a17
commit
f84ee3dab6
@@ -1144,13 +1144,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