diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2016-04-08 14:17:36 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2016-04-08 14:17:54 +0200 |
commit | 0afac87e8173dd71616e211aa08dcd59cb5cf90e (patch) | |
tree | 90f27e8fb3839b5e644e97078f8dae6d70886ef5 /src | |
parent | 232592a71f0237d95806d520035b051412362f53 (diff) | |
parent | da5fdbb3a2778523cce70d635c1aa2b31a693bc6 (diff) |
Merge #7835: Version 2 transactions remain non-standard until CSV activates
da5fdbb Test relay of version 2 transactions (Suhas Daftuar)
5cb1d8a Tests: move get_bip9_status to util.py (Suhas Daftuar)
e4ba9f6 Version 2 transactions remain non-standard until CSV activates (Suhas Daftuar)
Diffstat (limited to 'src')
-rw-r--r-- | src/main.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp index a9f104c88b..f5c7e11d6e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1025,6 +1025,14 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState& state, const C if (fRequireStandard && !IsStandardTx(tx, reason)) return state.DoS(0, false, REJECT_NONSTANDARD, reason); + // Don't relay version 2 transactions until CSV is active, and we can be + // sure that such transactions will be mined (unless we're on + // -testnet/-regtest). + const CChainParams& chainparams = Params(); + if (fRequireStandard && tx.nVersion >= 2 && VersionBitsTipState(chainparams.GetConsensus(), Consensus::DEPLOYMENT_CSV) != THRESHOLD_ACTIVE) { + return state.DoS(0, false, REJECT_NONSTANDARD, "premature-version2-tx"); + } + // Only accept nLockTime-using transactions that can be mined in the next // block; we don't want our mempool filled up with transactions that can't // be mined yet. |