From 57f0c3b38cd63c7c23e7a7fc497995504330908a Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 16 Oct 2015 11:59:45 +1030 Subject: [PATCH] test-cli/scripts: use setmocktime. TIL about setmocktime. Suggested-by: Gavin Signed-off-by: Rusty Russell --- test-cli/scripts/test.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test-cli/scripts/test.sh b/test-cli/scripts/test.sh index 4746e1336..fd5251f82 100755 --- a/test-cli/scripts/test.sh +++ b/test-cli/scripts/test.sh @@ -38,10 +38,9 @@ send_after_delay() # Bitcoin bumps block times so that blocks are valid. TIME=$($CLI getblock $($CLI getbestblockhash) | sed -n 's/.*"time" *: *\([0-9]*\),/\1/p') - echo Waiting for CSV timeout $(( $TIME + $TEST_LOCKTIME - $(date -u +%s) )) seconds. >&2 + $CLI setmocktime $(($TIME + $TEST_LOCKTIME)) # Move median time, for sure! - while [ `date -u +%s` -lt $(($TIME + $TEST_LOCKTIME)) ]; do sleep 1; done for i in `seq 6`; do scripts/generate-block.sh; done for tx; do