core-lightning/test-cli/scripts/generate-block.sh
Rusty Russell edcec2ba4e daemon/test: activate segwit.
You need to be running a bitcoind modified with segregated witness:

	https://github.com/sipa/bitcoin/tree/segwit4

It needs 432 blocks to activate it!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-04-12 14:17:45 +09:30

22 lines
496 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 '{ "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