@ -24,7 +24,7 @@ wait_for_start()
fi
done
# Wait for it to catch up with bitcoind.
while [ " $( $LCLI1 -H getinfo 2>/dev/null | grep '^blockheight=' | cut -d= -f2) " != " $( bitcoin-cli -regtest getblockcount) " ] ; do sleep 1; done
while [ " $( $LCLI1 -H getinfo | grep '^blockheight=' | cut -d= -f2) " != " $( bitcoin-cli -regtest getblockcount) " ] ; do sleep 1; done
echo " $ID "
}
@ -77,7 +77,14 @@ if ! bitcoin-cli -regtest ping >/dev/null 2>&1; then
while ! bitcoin-cli -regtest ping >/dev/null 2>& 1; do sleep 1; done
fi
LIGHTNINGD = "./lightningd/lightningd --network=regtest --dev-gossip-time=1550513768 --dev-unknown-channel-satoshis=100000"
DEVELOPER = $( grep '^DEVELOPER=' config.vars | cut -d= -f2-)
if [ $DEVELOPER = 1 ] ; then
LIGHTNINGD = "./lightningd/lightningd --network=regtest --dev-gossip-time=1550513768 --dev-unknown-channel-satoshis=100000"
else
# Means we can't do the peer_read_all test properly, since it will time out.
LIGHTNINGD = "./lightningd/lightningd --network=regtest"
fi
LCLI1 = " ./cli/lightning-cli --lightning-dir= $DIR -R "
if [ -z " $DIR " ] ; then
@ -110,7 +117,7 @@ if [ -z "${TARGETS##* vsz_kb *}" ]; then
fi
# How long does rewriting the store take?
if [ -z " ${ TARGETS ##* store_rewrite_sec * } " ] ; then
if [ -z " ${ TARGETS ##* store_rewrite_sec * } " -a " $DEVELOPER " = 1 ] ; then
# shellcheck disable=SC2086
/usr/bin/time --append -f %e $LCLI1 dev-compact-gossip-store 2>& 1 > /dev/null | print_stat store_rewrite_sec
fi
@ -141,12 +148,13 @@ fi
# Try getting all from the peer.
if [ -z " ${ TARGETS ##* peer_write_all_sec * } " ] ; then
ENTRIES = $( sed -n 's/.*gossipd.*: total store load time: [0-9]* msec (\([0-9]*\) entries, [0-9]* bytes)/\1/p' < " $DIR " /log)
ENTRIES = $( grep 'Read .* cannounce/cupdate/nannounce/cdelete' " $DIR " /log | cut -d\ -f5 | tr / + | bc)
/usr/bin/time --quiet --append -f %e devtools/gossipwith --initial-sync --max-messages= $(( ENTRIES - 5 )) " $ID " @" $DIR " /peer 2>& 1 > /dev/null | print_stat peer_write_all_sec
fi
if [ -z " ${ TARGETS ##* peer_read_all_sec * } " ] ; then
# Needs DEVELOPER otherwise timestamps will be more than 2 weeks old and it
# will ignore gossip.
if [ -z " ${ TARGETS ##* peer_read_all_sec * } " -a " $DEVELOPER " = 1 ] ; then
# shellcheck disable=SC2086
$LCLI1 stop > /dev/null
sleep 5