You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
496 B
22 lines
496 B
10 years ago
|
#! /bin/sh
|
||
9 years ago
|
# Generate a block.
|
||
10 years ago
|
|
||
|
set -e
|
||
|
|
||
|
. `dirname $0`/vars.sh
|
||
10 years ago
|
INIT=$1
|
||
10 years ago
|
|
||
9 years ago
|
# Initially we need 100 blocks so coinbase matures, giving us funds.
|
||
|
if [ -n "$INIT" ]; then
|
||
9 years ago
|
# 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
|
||
9 years ago
|
else
|
||
|
$CLI generate 1
|
||
|
fi
|