mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-23 09:04:22 +01:00
daemon: clean up test dirs.
Move final helpers out of test-cli/ Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
21
daemon/test/scripts/generate-block.sh
Executable file
21
daemon/test/scripts/generate-block.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#! /bin/sh
|
||||
# Generate a block.
|
||||
|
||||
set -e
|
||||
|
||||
. `dirname $0`/vars.sh
|
||||
INIT=$1
|
||||
|
||||
# Initially we need 100 blocks so coinbase matures, giving us funds.
|
||||
if [ -n "$INIT" ]; then
|
||||
# To activate segwit via BIP9, we need at least 432 blocks!
|
||||
$CLI generate 432
|
||||
if $CLI getblockchaininfo | tr -s '\012\011 ' ' ' | grep -q '{ "id": "witness", "status": "active" }'; then :
|
||||
else
|
||||
echo "Segwit not activated after 432 blocks?" >&2
|
||||
$CLI getblockchaininfo >&2
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
$CLI generate 1
|
||||
fi
|
||||
Reference in New Issue
Block a user