diff options
| author | Johnson Lau <[email protected]> | 2016-07-20 18:31:45 +0800 |
|---|---|---|
| committer | Johnson Lau <[email protected]> | 2016-07-22 06:35:07 +0000 |
| commit | 1ffaff2f747af683513d6d74a7241d41e3f6e051 (patch) | |
| tree | e1f4f43215830297e1c1e2781e7b9c2313a45200 /src/main.cpp | |
| parent | Merge #8378: [Wallet]Move SetMinVersion for FEATURE_HD to SetHDMasterKey (diff) | |
| download | discoin-1ffaff2f747af683513d6d74a7241d41e3f6e051.tar.xz discoin-1ffaff2f747af683513d6d74a7241d41e3f6e051.zip | |
Make witness v0 outputs non-standard before segwit activation
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp index fe19895f5..70f0a4247 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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 |