From 4c7ed36c9650065e5638d7ca5c7425c5cd50e3c7 Mon Sep 17 00:00:00 2001 From: zaidmstrr Date: Tue, 17 Jun 2025 20:38:21 +0530 Subject: [PATCH] test: Fix list index out of range error in feature_bip68_sequence.py Github-Pull: #32765 Rebased-From: e285e691b7a311e278f89e9fe423716de1ee268b --- test/functional/feature_bip68_sequence.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/functional/feature_bip68_sequence.py b/test/functional/feature_bip68_sequence.py index 2d61987e944..7f576464b80 100755 --- a/test/functional/feature_bip68_sequence.py +++ b/test/functional/feature_bip68_sequence.py @@ -148,8 +148,10 @@ class BIP68Test(BitcoinTestFramework): # between height/time locking). Small random chance of making the locks # all pass. for _ in range(400): + available_utxos = len(utxos) + # Randomly choose up to 10 inputs - num_inputs = random.randint(1, 10) + num_inputs = random.randint(1, min(10, available_utxos)) random.shuffle(utxos) # Track whether any sequence locks used should fail