mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 05:12:45 +01:00
test-cli/scripts: use setmocktime.
TIL about setmocktime. Suggested-by: Gavin <gavinandresen@gmail.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
32fe988fe8
commit
57f0c3b38c
@ -38,10 +38,9 @@ send_after_delay()
|
|||||||
|
|
||||||
# Bitcoin bumps block times so that blocks are valid.
|
# Bitcoin bumps block times so that blocks are valid.
|
||||||
TIME=$($CLI getblock $($CLI getbestblockhash) | sed -n 's/.*"time" *: *\([0-9]*\),/\1/p')
|
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!
|
# 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 i in `seq 6`; do scripts/generate-block.sh; done
|
||||||
|
|
||||||
for tx; do
|
for tx; do
|
||||||
|
Loading…
Reference in New Issue
Block a user