2015-06-30 05:18:06 +02:00
|
|
|
#! /bin/sh -e
|
|
|
|
|
|
|
|
. `dirname $0`/vars.sh
|
|
|
|
|
|
|
|
if $CLI getinfo 2>/dev/null; then
|
|
|
|
echo $DAEMON already running >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Start clean
|
|
|
|
rm -rf $DATADIR/$REGTESTDIR
|
|
|
|
|
|
|
|
$DAEMON &
|
|
|
|
i=0
|
|
|
|
while ! $CLI getinfo >/dev/null 2>&1; do
|
|
|
|
if [ $i -gt 30 ]; then
|
|
|
|
echo $DAEMON start failed? >&1
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
sleep 1
|
|
|
|
i=$(($i + 1))
|
|
|
|
done
|
|
|
|
|
|
|
|
scripts/generate-block.sh init
|
|
|
|
|
|
|
|
A1=`scripts/get-new-address.sh`
|
2015-09-24 07:30:47 +02:00
|
|
|
TX=`$CLI sendmany "" "{ \"$A1\":0.01 }"`
|
2015-06-30 05:18:06 +02:00
|
|
|
scripts/generate-block.sh
|
|
|
|
|
2015-09-24 07:30:47 +02:00
|
|
|
# Find the inputs number corresponding to that 0.01 btc out
|
2015-07-29 08:44:28 +02:00
|
|
|
echo "Argument to test.sh:"
|
2015-09-24 07:30:47 +02:00
|
|
|
for i in $(seq 1 $($CLI listunspent | grep -c txid) ); do scripts/getinput.sh $i | grep -q "$TX.*/1000000/" && echo -n "$i "; done
|
2015-06-30 05:18:06 +02:00
|
|
|
echo
|