core-lightning/test-cli/scripts/get-new-address.sh
Rusty Russell 8f4426e09b scripts: move to scripts/ subdir, prepare for alpha.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-06-30 12:08:18 +09:30

18 lines
340 B
Bash
Executable File

#! /bin/sh
# Alpha defaults to confidential addresses. We don't handle those (yet?)
# so extract the unconfidential address.
set -e
. `dirname $0`/vars.sh
case $STYLE in
alpha)
A=`$CLI getnewaddress`
$CLI validateaddress $A | sed -n 's/.*"unconfidential" : "\([A-Za-z0-9]*\)".*/\1/p'
;;
bitcoin)
$CLI getnewaddress
;;
esac