Skip to content

Commit 1c93b9b

Browse files
committed
[Consensus] Bury CSV deployment height
Hard code CSV deployment height to 419328 for mainnet.
1 parent 3862e47 commit 1c93b9b

File tree

8 files changed

+54
-98
lines changed

8 files changed

+54
-98
lines changed

src/chainparams.cpp

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ class CMainParams : public CChainParams {
6969
consensus.BIP34Hash = uint256S("0x000000000000024b89b42a942fe0d9fea3bb44ab7bd1b19115dd6a759c0808b8");
7070
consensus.BIP65Height = 388381; // 000000000000000004c2b624ed5d7756c508d90fd0da2c7c679febfa6c4735f0
7171
consensus.BIP66Height = 363725; // 00000000000000000379eaa19dce8c9b722d46ae6a57c2f1a988119488b50931
72+
consensus.CSVHeight = 419328; // 000000000000000004a1b34462cb8aeebd5799177f7a29cf28f2d1961716b5b5
7273
consensus.powLimit = uint256S("00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
7374
consensus.nPowTargetTimespan = 14 * 24 * 60 * 60; // two weeks
7475
consensus.nPowTargetSpacing = 10 * 60;
@@ -80,11 +81,6 @@ class CMainParams : public CChainParams {
8081
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 1199145601; // January 1, 2008
8182
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = 1230767999; // December 31, 2008
8283

83-
// Deployment of BIP68, BIP112, and BIP113.
84-
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].bit = 0;
85-
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nStartTime = 1462060800; // May 1st, 2016
86-
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nTimeout = 1493596800; // May 1st, 2017
87-
8884
// Deployment of SegWit (BIP141, BIP143, and BIP147)
8985
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].bit = 1;
9086
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nStartTime = 1479168000; // November 15th, 2016.
@@ -183,6 +179,7 @@ class CTestNetParams : public CChainParams {
183179
consensus.BIP34Hash = uint256S("0x0000000023b3a96d3484e5abb3755c413e7d41500f8e2a5c3f0dd01299cd8ef8");
184180
consensus.BIP65Height = 581885; // 00000000007f6655f22f98e72ed80d8b06dc761d5da09df0fa1dc4be4f861eb6
185181
consensus.BIP66Height = 330776; // 000000002104c8c45e99a8853285a3b592602a3ccde2b832481da85e9e4ba182
182+
consensus.CSVHeight = 770112; // 00000000025e930139bac5c6c31a403776da130831ab85be56578f3fa75369bb
186183
consensus.powLimit = uint256S("00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
187184
consensus.nPowTargetTimespan = 14 * 24 * 60 * 60; // two weeks
188185
consensus.nPowTargetSpacing = 10 * 60;
@@ -194,11 +191,6 @@ class CTestNetParams : public CChainParams {
194191
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 1199145601; // January 1, 2008
195192
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = 1230767999; // December 31, 2008
196193

197-
// Deployment of BIP68, BIP112, and BIP113.
198-
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].bit = 0;
199-
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nStartTime = 1456790400; // March 1st, 2016
200-
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nTimeout = 1493596800; // May 1st, 2017
201-
202194
// Deployment of SegWit (BIP141, BIP143, and BIP147)
203195
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].bit = 1;
204196
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nStartTime = 1462060800; // May 1st 2016
@@ -275,6 +267,7 @@ class CRegTestParams : public CChainParams {
275267
consensus.BIP34Hash = uint256();
276268
consensus.BIP65Height = 1351; // BIP65 activated on regtest (Used in functional tests)
277269
consensus.BIP66Height = 1251; // BIP66 activated on regtest (Used in functional tests)
270+
consensus.CSVHeight = 432; // CSV activated on regtest (Used in rpc activation tests)
278271
consensus.powLimit = uint256S("7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
279272
consensus.nPowTargetTimespan = 14 * 24 * 60 * 60; // two weeks
280273
consensus.nPowTargetSpacing = 10 * 60;
@@ -285,9 +278,6 @@ class CRegTestParams : public CChainParams {
285278
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28;
286279
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 0;
287280
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;
288-
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].bit = 0;
289-
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nStartTime = 0;
290-
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;
291281
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].bit = 1;
292282
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nStartTime = Consensus::BIP9Deployment::ALWAYS_ACTIVE;
293283
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;

src/consensus/params.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ namespace Consensus {
1616
enum DeploymentPos
1717
{
1818
DEPLOYMENT_TESTDUMMY,
19-
DEPLOYMENT_CSV, // Deployment of BIP68, BIP112, and BIP113.
2019
DEPLOYMENT_SEGWIT, // Deployment of BIP141, BIP143, and BIP147.
2120
// NOTE: Also add new deployments to VersionBitsDeploymentInfo in versionbits.cpp
2221
MAX_VERSION_BITS_DEPLOYMENTS
@@ -58,6 +57,8 @@ struct Params {
5857
int BIP65Height;
5958
/** Block height at which BIP66 becomes active */
6059
int BIP66Height;
60+
/** Block height at which CSV (BIP68, BIP112 and BIP113) becomes active */
61+
int CSVHeight;
6162
/**
6263
* Minimum blocks including miner confirmation of the total of 2016 blocks in a retargeting period,
6364
* (nPowTargetTimespan / nPowTargetSpacing) which is also used for BIP9 deployments.

src/rpc/blockchain.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1337,7 +1337,7 @@ UniValue getblockchaininfo(const JSONRPCRequest& request)
13371337
BuriedForkDescPushBack(softforks, "bip34", consensusParams.BIP34Height);
13381338
BuriedForkDescPushBack(softforks, "bip66", consensusParams.BIP66Height);
13391339
BuriedForkDescPushBack(softforks, "bip65", consensusParams.BIP65Height);
1340-
BIP9SoftForkDescPushBack(softforks, "csv", consensusParams, Consensus::DEPLOYMENT_CSV);
1340+
BuriedForkDescPushBack(softforks, "csv", consensusParams.CSVHeight);
13411341
BIP9SoftForkDescPushBack(softforks, "segwit", consensusParams, Consensus::DEPLOYMENT_SEGWIT);
13421342
BIP9SoftForkDescPushBack(softforks, "testdummy", consensusParams, Consensus::DEPLOYMENT_TESTDUMMY);
13431343
obj.pushKV("softforks", softforks);

src/validation.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1644,8 +1644,8 @@ static unsigned int GetBlockScriptFlags(const CBlockIndex* pindex, const Consens
16441644
flags |= SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY;
16451645
}
16461646

1647-
// Start enforcing BIP68 (sequence locks) and BIP112 (CHECKSEQUENCEVERIFY) using versionbits logic.
1648-
if (VersionBitsState(pindex->pprev, consensusparams, Consensus::DEPLOYMENT_CSV, versionbitscache) == ThresholdState::ACTIVE) {
1647+
// Start enforcing BIP112 (CHECKSEQUENCEVERIFY)
1648+
if (pindex->nHeight >= consensusparams.CSVHeight) {
16491649
flags |= SCRIPT_VERIFY_CHECKSEQUENCEVERIFY;
16501650
}
16511651

@@ -1834,9 +1834,9 @@ bool CChainState::ConnectBlock(const CBlock& block, CValidationState& state, CBl
18341834
}
18351835
}
18361836

1837-
// Start enforcing BIP68 (sequence locks) and BIP112 (CHECKSEQUENCEVERIFY) using versionbits logic.
1837+
// Start enforcing BIP68 (sequence locks)
18381838
int nLockTimeFlags = 0;
1839-
if (VersionBitsState(pindex->pprev, chainparams.GetConsensus(), Consensus::DEPLOYMENT_CSV, versionbitscache) == ThresholdState::ACTIVE) {
1839+
if (pindex->nHeight >= chainparams.GetConsensus().CSVHeight) {
18401840
nLockTimeFlags |= LOCKTIME_VERIFY_SEQUENCE;
18411841
}
18421842

@@ -3185,9 +3185,9 @@ static bool ContextualCheckBlock(const CBlock& block, CValidationState& state, c
31853185
{
31863186
const int nHeight = pindexPrev == nullptr ? 0 : pindexPrev->nHeight + 1;
31873187

3188-
// Start enforcing BIP113 (Median Time Past) using versionbits logic.
3188+
// Start enforcing BIP113 (Median Time Past).
31893189
int nLockTimeFlags = 0;
3190-
if (VersionBitsState(pindexPrev, consensusParams, Consensus::DEPLOYMENT_CSV, versionbitscache) == ThresholdState::ACTIVE) {
3190+
if (nHeight >= consensusParams.CSVHeight) {
31913191
assert(pindexPrev != nullptr);
31923192
nLockTimeFlags |= LOCKTIME_MEDIAN_TIME_PAST;
31933193
}

src/versionbitsinfo.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ const struct VBDeploymentInfo VersionBitsDeploymentInfo[Consensus::MAX_VERSION_B
1111
/*.name =*/ "testdummy",
1212
/*.gbt_force =*/ true,
1313
},
14-
{
15-
/*.name =*/ "csv",
16-
/*.gbt_force =*/ true,
17-
},
1814
{
1915
/*.name =*/ "segwit",
2016
/*.gbt_force =*/ true,

test/functional/feature_bip68_sequence.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
assert_equal,
1515
assert_greater_than,
1616
assert_raises_rpc_error,
17-
get_bip9_status,
1817
satoshi_round,
18+
softfork_active,
1919
)
2020

2121
SEQUENCE_LOCKTIME_DISABLE_FLAG = (1<<31)
@@ -52,7 +52,7 @@ def run_test(self):
5252
self.log.info("Running test sequence-lock-unconfirmed-inputs")
5353
self.test_sequence_lock_unconfirmed_inputs()
5454

55-
self.log.info("Running test BIP68 not consensus before versionbits activation")
55+
self.log.info("Running test BIP68 not consensus before activation")
5656
self.test_bip68_not_consensus()
5757

5858
self.log.info("Activating BIP68 (and 112/113)")
@@ -336,12 +336,12 @@ def test_nonzero_locks(orig_tx, node, relayfee, use_height_lock):
336336
self.nodes[0].invalidateblock(self.nodes[0].getblockhash(cur_height+1))
337337
self.nodes[0].generate(10)
338338

339-
# Make sure that BIP68 isn't being used to validate blocks, prior to
340-
# versionbits activation. If more blocks are mined prior to this test
339+
# Make sure that BIP68 isn't being used to validate blocks prior to
340+
# activation height. If more blocks are mined prior to this test
341341
# being run, then it's possible the test has activated the soft fork, and
342342
# this test should be moved to run earlier, or deleted.
343343
def test_bip68_not_consensus(self):
344-
assert get_bip9_status(self.nodes[0], 'csv')['status'] != 'active'
344+
assert not softfork_active(self.nodes[0], 'csv')
345345
txid = self.nodes[0].sendtoaddress(self.nodes[0].getnewaddress(), 2)
346346

347347
tx1 = FromHex(CTransaction(), self.nodes[0].getrawtransaction(txid))
@@ -391,9 +391,9 @@ def activateCSV(self):
391391
height = self.nodes[0].getblockcount()
392392
assert_greater_than(min_activation_height - height, 2)
393393
self.nodes[0].generate(min_activation_height - height - 2)
394-
assert_equal(get_bip9_status(self.nodes[0], 'csv')['status'], "locked_in")
394+
assert not softfork_active(self.nodes[0], 'csv')
395395
self.nodes[0].generate(1)
396-
assert_equal(get_bip9_status(self.nodes[0], 'csv')['status'], "active")
396+
assert softfork_active(self.nodes[0], 'csv')
397397
self.sync_blocks()
398398

399399
# Use self.nodes[1] to test that version 2 transactions are standard.

test/functional/feature_csv_activation.py

Lines changed: 31 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,17 @@
22
# Copyright (c) 2015-2019 The Bitcoin Core developers
33
# Distributed under the MIT software license, see the accompanying
44
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
5-
"""Test activation of the first version bits soft fork.
5+
"""Test CSV soft fork activation.
66
77
This soft fork will activate the following BIPS:
88
BIP 68 - nSequence relative lock times
99
BIP 112 - CHECKSEQUENCEVERIFY
1010
BIP 113 - MedianTimePast semantics for nLockTime
1111
12-
regtest lock-in with 108/144 block signalling
13-
activation after a further 144 blocks
14-
1512
mine 82 blocks whose coinbases will be used to generate inputs for our tests
16-
mine 61 blocks to transition from DEFINED to STARTED
17-
mine 144 blocks only 100 of which are signaling readiness in order to fail to change state this period
18-
mine 144 blocks with 108 signaling and verify STARTED->LOCKED_IN
19-
mine 140 blocks and seed block chain with the 82 inputs will use for our tests at height 572
20-
mine 3 blocks and verify still at LOCKED_IN and test that enforcement has not triggered
21-
mine 1 block and test that enforcement has triggered (which triggers ACTIVE)
13+
mine 345 blocks and seed block chain with the 82 inputs will use for our tests at height 427
14+
mine 2 blocks and verify soft fork not yet activated
15+
mine 1 block and test that soft fork is activated (rules enforced for next block)
2216
Test BIP 113 is enforced
2317
Mine 4 blocks so next height is 580 and test BIP 68 is enforced for time and height
2418
Mine 1 block so next height is 581 and test BIP 68 now passes time but not height
@@ -58,11 +52,12 @@
5852
from test_framework.test_framework import BitcoinTestFramework
5953
from test_framework.util import (
6054
assert_equal,
61-
get_bip9_status,
6255
hex_str_to_bytes,
56+
softfork_active,
6357
)
6458

6559
BASE_RELATIVE_LOCKTIME = 10
60+
CSV_ACTIVATION_HEIGHT = 432
6661
SEQ_DISABLE_FLAG = 1 << 31
6762
SEQ_RANDOM_HIGH_BIT = 1 << 25
6863
SEQ_TYPE_FLAG = 1 << 22
@@ -148,20 +143,19 @@ def set_test_params(self):
148143
def skip_test_if_missing_module(self):
149144
self.skip_if_no_wallet()
150145

151-
def generate_blocks(self, number, version, test_blocks=None):
152-
if test_blocks is None:
153-
test_blocks = []
146+
def generate_blocks(self, number):
147+
test_blocks = []
154148
for i in range(number):
155-
block = self.create_test_block([], version)
149+
block = self.create_test_block([])
156150
test_blocks.append(block)
157151
self.last_block_time += 600
158152
self.tip = block.sha256
159153
self.tipheight += 1
160154
return test_blocks
161155

162-
def create_test_block(self, txs, version=536870912):
156+
def create_test_block(self, txs):
163157
block = create_block(self.tip, create_coinbase(self.tipheight + 1), self.last_block_time + 600)
164-
block.nVersion = version
158+
block.nVersion = 4
165159
block.vtx.extend(txs)
166160
block.hashMerkleRoot = block.calc_merkle_root()
167161
block.rehash()
@@ -187,45 +181,14 @@ def run_test(self):
187181
self.tip = int(self.nodes[0].getbestblockhash(), 16)
188182
self.nodeaddress = self.nodes[0].getnewaddress()
189183

190-
self.log.info("Test that the csv softfork is DEFINED")
191-
assert_equal(get_bip9_status(self.nodes[0], 'csv')['status'], 'defined')
192-
test_blocks = self.generate_blocks(61, 4)
193-
self.send_blocks(test_blocks)
194-
195-
self.log.info("Advance from DEFINED to STARTED, height = 143")
196-
assert_equal(get_bip9_status(self.nodes[0], 'csv')['status'], 'started')
197-
198-
self.log.info("Fail to achieve LOCKED_IN")
199-
# 100 out of 144 signal bit 0. Use a variety of bits to simulate multiple parallel softforks
200-
201-
test_blocks = self.generate_blocks(50, 536870913) # 0x20000001 (signalling ready)
202-
test_blocks = self.generate_blocks(20, 4, test_blocks) # 0x00000004 (signalling not)
203-
test_blocks = self.generate_blocks(50, 536871169, test_blocks) # 0x20000101 (signalling ready)
204-
test_blocks = self.generate_blocks(24, 536936448, test_blocks) # 0x20010000 (signalling not)
205-
self.send_blocks(test_blocks)
206-
207-
self.log.info("Failed to advance past STARTED, height = 287")
208-
assert_equal(get_bip9_status(self.nodes[0], 'csv')['status'], 'started')
209-
210-
self.log.info("Generate blocks to achieve LOCK-IN")
211-
# 108 out of 144 signal bit 0 to achieve lock-in
212-
# using a variety of bits to simulate multiple parallel softforks
213-
test_blocks = self.generate_blocks(58, 536870913) # 0x20000001 (signalling ready)
214-
test_blocks = self.generate_blocks(26, 4, test_blocks) # 0x00000004 (signalling not)
215-
test_blocks = self.generate_blocks(50, 536871169, test_blocks) # 0x20000101 (signalling ready)
216-
test_blocks = self.generate_blocks(10, 536936448, test_blocks) # 0x20010000 (signalling not)
217-
self.send_blocks(test_blocks)
218-
219-
self.log.info("Advanced from STARTED to LOCKED_IN, height = 431")
220-
assert_equal(get_bip9_status(self.nodes[0], 'csv')['status'], 'locked_in')
221-
222-
# Generate 140 more version 4 blocks
223-
test_blocks = self.generate_blocks(140, 4)
184+
# Activation height is hardcoded
185+
test_blocks = self.generate_blocks(345)
224186
self.send_blocks(test_blocks)
187+
assert not softfork_active(self.nodes[0], 'csv')
225188

226-
# Inputs at height = 572
189+
# Inputs at height = 431
227190
#
228-
# Put inputs for all tests in the chain at height 572 (tip now = 571) (time increases by 600s per block)
191+
# Put inputs for all tests in the chain at height 431 (tip now = 430) (time increases by 600s per block)
229192
# Note we reuse inputs for v1 and v2 txs so must test these separately
230193
# 16 normal inputs
231194
bip68inputs = []
@@ -255,19 +218,20 @@ def run_test(self):
255218
bip113input = send_generic_input_tx(self.nodes[0], self.coinbase_blocks, self.nodeaddress)
256219

257220
self.nodes[0].setmocktime(self.last_block_time + 600)
258-
inputblockhash = self.nodes[0].generate(1)[0] # 1 block generated for inputs to be in chain at height 572
221+
inputblockhash = self.nodes[0].generate(1)[0] # 1 block generated for inputs to be in chain at height 431
259222
self.nodes[0].setmocktime(0)
260223
self.tip = int(inputblockhash, 16)
261224
self.tipheight += 1
262225
self.last_block_time += 600
263226
assert_equal(len(self.nodes[0].getblock(inputblockhash, True)["tx"]), 82 + 1)
264227

265228
# 2 more version 4 blocks
266-
test_blocks = self.generate_blocks(2, 4)
229+
test_blocks = self.generate_blocks(2)
267230
self.send_blocks(test_blocks)
268231

269-
self.log.info("Not yet advanced to ACTIVE, height = 574 (will activate for block 576, not 575)")
270-
assert_equal(get_bip9_status(self.nodes[0], 'csv')['status'], 'locked_in')
232+
assert_equal(self.tipheight, CSV_ACTIVATION_HEIGHT - 2)
233+
self.log.info("Height = {}, CSV not yet active (will activate for block {}, not {})".format(self.tipheight, CSV_ACTIVATION_HEIGHT, CSV_ACTIVATION_HEIGHT - 1))
234+
assert not softfork_active(self.nodes[0], 'csv')
271235

272236
# Test both version 1 and version 2 transactions for all tests
273237
# BIP113 test transaction will be modified before each use to put in appropriate block time
@@ -340,10 +304,11 @@ def run_test(self):
340304
self.send_blocks([self.create_test_block(success_txs)])
341305
self.nodes[0].invalidateblock(self.nodes[0].getbestblockhash())
342306

343-
# 1 more version 4 block to get us to height 575 so the fork should now be active for the next block
344-
test_blocks = self.generate_blocks(1, 4)
307+
# 1 more version 4 block to get us to height 432 so the fork should now be active for the next block
308+
assert not softfork_active(self.nodes[0], 'csv')
309+
test_blocks = self.generate_blocks(1)
345310
self.send_blocks(test_blocks)
346-
assert_equal(get_bip9_status(self.nodes[0], 'csv')['status'], 'active')
311+
assert softfork_active(self.nodes[0], 'csv')
347312

348313
self.log.info("Post-Soft Fork Tests.")
349314

@@ -364,8 +329,8 @@ def run_test(self):
364329
self.send_blocks([self.create_test_block([bip113tx])])
365330
self.nodes[0].invalidateblock(self.nodes[0].getbestblockhash())
366331

367-
# Next block height = 580 after 4 blocks of random version
368-
test_blocks = self.generate_blocks(4, 1234)
332+
# Next block height = 437 after 4 blocks of random version
333+
test_blocks = self.generate_blocks(4)
369334
self.send_blocks(test_blocks)
370335

371336
self.log.info("BIP 68 tests")
@@ -392,8 +357,8 @@ def run_test(self):
392357
for tx in bip68heighttxs:
393358
self.send_blocks([self.create_test_block([tx])], success=False)
394359

395-
# Advance one block to 581
396-
test_blocks = self.generate_blocks(1, 1234)
360+
# Advance one block to 438
361+
test_blocks = self.generate_blocks(1)
397362
self.send_blocks(test_blocks)
398363

399364
# Height txs should fail and time txs should now pass 9 * 600 > 10 * 512
@@ -403,8 +368,8 @@ def run_test(self):
403368
for tx in bip68heighttxs:
404369
self.send_blocks([self.create_test_block([tx])], success=False)
405370

406-
# Advance one block to 582
407-
test_blocks = self.generate_blocks(1, 1234)
371+
# Advance one block to 439
372+
test_blocks = self.generate_blocks(1)
408373
self.send_blocks(test_blocks)
409374

410375
# All BIP 68 txs should pass

test/functional/test_framework/util.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,10 @@ def get_bip9_status(node, key):
346346
info = node.getblockchaininfo()
347347
return info['softforks'][key]['bip9']
348348

349+
def softfork_active(node, key):
350+
"""Return whether a softfork is active."""
351+
return node.getblockchaininfo()['softforks'][key]['active']
352+
349353
def set_node_times(nodes, t):
350354
for node in nodes:
351355
node.setmocktime(t)

0 commit comments

Comments
 (0)