getinput.sh: Switch to -regtest

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2015-06-08 06:28:09 +09:30
parent 9ed6968fe5
commit baf5d11643

View File

@ -23,13 +23,13 @@ if [ $# -gt 0 ]; then
fi fi
if [ -n "$KEY" ]; then if [ -n "$KEY" ]; then
ADDR=`bitcoin-cli -testnet listunspent | sed -n 's/^ "address" : "\([0-9a-zA-Z]*\)",$/\1/p' | tail -n +$NUM | head -n1` ADDR=`bitcoin-cli -regtest listunspent | sed -n 's/^ "address" : "\([0-9a-zA-Z]*\)",$/\1/p' | tail -n +$NUM | head -n1`
bitcoin-cli dumpprivkey $ADDR bitcoin-cli dumpprivkey $ADDR
else else
TXID=`bitcoin-cli -testnet listunspent | sed -n 's/^ "txid" : "\([0-9a-f]*\)",$/\1/p' | tail -n +$NUM | head -n1` TXID=`bitcoin-cli -regtest listunspent | sed -n 's/^ "txid" : "\([0-9a-f]*\)",$/\1/p' | tail -n +$NUM | head -n1`
OUTNUM=`bitcoin-cli -testnet listunspent | sed -n 's/^ "vout" : \([0-9]*\),$/\1/p' | tail -n +$NUM | head -n1` OUTNUM=`bitcoin-cli -regtest listunspent | sed -n 's/^ "vout" : \([0-9]*\),$/\1/p' | tail -n +$NUM | head -n1`
AMOUNT=`bitcoin-cli -testnet listunspent | sed -n 's/^ "amount" : \([0-9.]*\),$/\1/p' | tail -n +$NUM | head -n1 | tr -d . | sed 's/^0*//'` AMOUNT=`bitcoin-cli -regtest listunspent | sed -n 's/^ "amount" : \([0-9.]*\),$/\1/p' | tail -n +$NUM | head -n1 | tr -d . | sed 's/^0*//'`
SCRIPT=`bitcoin-cli -testnet listunspent | sed -n 's/^ "scriptPubKey" : "\([0-9a-f]*\)",$/\1/p' | tail -n +$NUM | head -n1` SCRIPT=`bitcoin-cli -regtest listunspent | sed -n 's/^ "scriptPubKey" : "\([0-9a-f]*\)",$/\1/p' | tail -n +$NUM | head -n1`
echo $TXID/$OUTNUM/$AMOUNT/$SCRIPT echo $TXID/$OUTNUM/$AMOUNT/$SCRIPT
fi fi