Skip to content

Commit 49f869f

Browse files
committed
Fix bip68-sequence rpc test
1 parent 12ed800 commit 49f869f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test/functional/bip68-sequence.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -369,11 +369,14 @@ def test_bip68_not_consensus(self):
369369

370370
def activateCSV(self):
371371
# activation should happen at block height 432 (3 periods)
372+
# getblockchaininfo will show CSV as active at block 431 (144 * 3 -1) since it's returning whether CSV is active for the next block.
372373
min_activation_height = 432
373374
height = self.nodes[0].getblockcount()
374-
assert(height < min_activation_height)
375-
self.nodes[0].generate(min_activation_height-height)
376-
assert(get_bip9_status(self.nodes[0], 'csv')['status'] == 'active')
375+
assert_greater_than(min_activation_height - height, 2)
376+
self.nodes[0].generate(min_activation_height - height - 2)
377+
assert_equal(get_bip9_status(self.nodes[0], 'csv')['status'], "locked_in")
378+
self.nodes[0].generate(1)
379+
assert_equal(get_bip9_status(self.nodes[0], 'csv')['status'], "active")
377380
sync_blocks(self.nodes)
378381

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

0 commit comments

Comments
 (0)