2015-06-25 06:19:17 +02:00
|
|
|
#! /bin/sh
|
2015-09-30 03:24:11 +02:00
|
|
|
# Generate a block.
|
2015-06-25 06:19:17 +02:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
. `dirname $0`/vars.sh
|
2015-06-30 05:18:06 +02:00
|
|
|
INIT=$1
|
2015-06-25 06:19:17 +02:00
|
|
|
|
|
|
|
case $STYLE in
|
|
|
|
alpha)
|
|
|
|
# This is a one-shot in alpha, it seems.
|
|
|
|
$CLI setgenerate true
|
2015-09-30 03:24:11 +02:00
|
|
|
# Avoid median time bug by generating 11 blocks
|
|
|
|
if [ -n "$INIT" ]; then
|
2015-10-02 03:10:07 +02:00
|
|
|
for i in `seq 11`; do $CLI setgenerate true; done
|
2015-09-30 03:24:11 +02:00
|
|
|
fi
|
2015-06-25 06:19:17 +02:00
|
|
|
;;
|
|
|
|
bitcoin)
|
2015-06-30 05:18:06 +02:00
|
|
|
# Initially we need 100 blocks so coinbase matures, giving us funds.
|
|
|
|
if [ -n "$INIT" ]; then
|
|
|
|
$CLI generate 101
|
|
|
|
else
|
|
|
|
$CLI generate 1
|
|
|
|
fi
|
2015-06-25 06:19:17 +02:00
|
|
|
;;
|
|
|
|
esac
|