Browse Source
I use this to look up on smartbit.com.au to see if a channel is spent, for example. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>ppa-0.6.1
Rusty Russell
6 years ago
committed by
Christian Decker
1 changed files with 15 additions and 0 deletions
@ -0,0 +1,15 @@ |
|||
#! /bin/sh |
|||
|
|||
set -e |
|||
|
|||
if [ "$#" != 1 ]; then |
|||
echo Usage: "$0" "short:channel:id" >&2 |
|||
echo Uses bitcoin-cli to extract the actual txid >&2 |
|||
exit 1 |
|||
fi |
|||
|
|||
BLOCK=$(echo "$1" | cut -d: -f1) |
|||
TXNUM=$(echo "$1" | cut -d: -f2) |
|||
|
|||
bitcoin-cli getblock "$(bitcoin-cli getblockhash "$BLOCK")" true | grep '^ "' | head -n "$((TXNUM + 1))" | tail -n 1 | tr -dc '0-9a-f\n' |
|||
|
Loading…
Reference in new issue