mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-20 10:39:49 +01:00
2436207a7a
Segwit was merged, but the strings changed between there and segwit4 (also, my BIP9 patch changed the output). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
22 lines
488 B
Bash
Executable File
22 lines
488 B
Bash
Executable File
#! /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 '"segwit": { "status": "active",'; then :
|
|
else
|
|
echo "Segwit not activated after 432 blocks?" >&2
|
|
$CLI getblockchaininfo >&2
|
|
exit 1
|
|
fi
|
|
else
|
|
$CLI generate 1
|
|
fi
|