helpers.sh: make check_tx_spend able to check for a specific transaction.

It currently takes an unused "who to blame" argument, which doesn't
always make sense.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2016-11-10 23:34:35 +10:30
parent c6a187a5d7
commit fae7f68731
2 changed files with 16 additions and 10 deletions

View File

@@ -393,9 +393,15 @@ check_status()
check_tx_spend()
{
if check "$CLI getrawmempool | $FGREP '\"'"; then :;
local FAIL
FAIL=0
if [ $# = 1 ]; then
check "$CLI getrawmempool | $FGREP $1" || FAIL=1
else
echo "No tx in mempool:" >&2
check "$CLI getrawmempool | $FGREP '\"'" || FAIL=1
fi
if [ $FAIL = 1 ]; then
echo "No tx $1 in mempool:" >&2
$CLI getrawmempool >&2
exit 1
fi