|
|
@ -982,7 +982,7 @@ lcli2 dev-routefail true |
|
|
|
RHASH3=`lcli2 invoice $HTLC_AMOUNT RHASH3 | sed 's/.*"\([0-9a-f]*\)".*/\1/'` |
|
|
|
|
|
|
|
lcli2 listinvoice |
|
|
|
[ "`lcli2 listinvoice | tr -s '\012\011\" ' ' '`" = "{ [ { label : RHASH3 , rhash : $RHASH3 , msatoshi : $HTLC_AMOUNT, complete : false } ] } " ] |
|
|
|
[ "`lcli2 listinvoice | tr -s '\012\011\" ' ' '`" = "[ { label : RHASH3 , rhash : $RHASH3 , msatoshi : $HTLC_AMOUNT, complete : false } ] " ] |
|
|
|
|
|
|
|
HTLCID3=`lcli1 dev-newhtlc $ID2 $HTLC_AMOUNT $EXPIRY $RHASH3 | extract_id` |
|
|
|
[ ! -n "$MANUALCOMMIT" ] || lcli1 dev-commit $ID2 |
|
|
@ -996,7 +996,7 @@ A_AMOUNT=$(($A_AMOUNT - $HTLC_AMOUNT)) |
|
|
|
B_AMOUNT=$(($B_AMOUNT + $HTLC_AMOUNT)) |
|
|
|
check_status $A_AMOUNT $A_FEE "" $B_AMOUNT $B_FEE "" |
|
|
|
|
|
|
|
[ "`lcli2 listinvoice | tr -s '\012\011\" ' ' '`" = "{ [ { label : RHASH3 , rhash : $RHASH3 , msatoshi : $HTLC_AMOUNT, complete : true } ] } " ] |
|
|
|
[ "`lcli2 listinvoice | tr -s '\012\011\" ' ' '`" = "[ { label : RHASH3 , rhash : $RHASH3 , msatoshi : $HTLC_AMOUNT, complete : true } ] " ] |
|
|
|
|
|
|
|
# Now, failed payment (didn't pay enough) |
|
|
|
RHASH4=`lcli2 invoice $HTLC_AMOUNT RHASH4 | sed 's/.*"\([0-9a-f]*\)".*/\1/'` |
|
|
@ -1006,9 +1006,9 @@ if lcli2 getlog | $FGREP 'Short payment for'; then exit 1; fi |
|
|
|
|
|
|
|
# Test listinvoice with both, or subset (either order possible!) |
|
|
|
INVOICES=`lcli2 listinvoice | tr -s '\012\011\" ' ' '` |
|
|
|
[ "$INVOICES" = "{ [ { label : RHASH3 , rhash : $RHASH3 , msatoshi : $HTLC_AMOUNT, complete : true }, { label : RHASH4 , rhash : $RHASH4 , msatoshi : $HTLC_AMOUNT, complete : false } ] } " ] || [ "$INVOICES" = "{ [ { label : RHASH4 , rhash : $RHASH4 , msatoshi : $HTLC_AMOUNT, complete : false }, { label : RHASH3 , rhash : $RHASH3 , msatoshi : $HTLC_AMOUNT, complete : true } ] } " ] |
|
|
|
[ "`lcli2 listinvoice RHASH3 | tr -s '\012\011\" ' ' '`" = "{ [ { label : RHASH3 , rhash : $RHASH3 , msatoshi : $HTLC_AMOUNT, complete : true } ] } " ] |
|
|
|
[ "`lcli2 listinvoice RHASH4 | tr -s '\012\011\" ' ' '`" = "{ [ { label : RHASH4 , rhash : $RHASH4 , msatoshi : $HTLC_AMOUNT, complete : false } ] } " ] |
|
|
|
[ "$INVOICES" = "[ { label : RHASH3 , rhash : $RHASH3 , msatoshi : $HTLC_AMOUNT, complete : true }, { label : RHASH4 , rhash : $RHASH4 , msatoshi : $HTLC_AMOUNT, complete : false } ] " ] || [ "$INVOICES" = "[ { label : RHASH4 , rhash : $RHASH4 , msatoshi : $HTLC_AMOUNT, complete : false }, { label : RHASH3 , rhash : $RHASH3 , msatoshi : $HTLC_AMOUNT, complete : true } ] " ] |
|
|
|
[ "`lcli2 listinvoice RHASH3 | tr -s '\012\011\" ' ' '`" = "[ { label : RHASH3 , rhash : $RHASH3 , msatoshi : $HTLC_AMOUNT, complete : true } ] " ] |
|
|
|
[ "`lcli2 listinvoice RHASH4 | tr -s '\012\011\" ' ' '`" = "[ { label : RHASH4 , rhash : $RHASH4 , msatoshi : $HTLC_AMOUNT, complete : false } ] " ] |
|
|
|
|
|
|
|
HTLCID4=`lcli1 dev-newhtlc $ID2 $(($HTLC_AMOUNT - 1)) $EXPIRY $RHASH4 | extract_id` |
|
|
|
[ ! -n "$MANUALCOMMIT" ] || lcli1 dev-commit $ID2 |
|
|
@ -1076,7 +1076,7 @@ if [ ! -n "$MANUALCOMMIT" ]; then |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
[ "`lcli3 listinvoice RHASH5 | tr -s '\012\011\" ' ' '`" = "{ [ { label : RHASH5 , rhash : $RHASH5 , msatoshi : $HTLC_AMOUNT, complete : false } ] } " ] |
|
|
|
[ "`lcli3 listinvoice RHASH5 | tr -s '\012\011\" ' ' '`" = "[ { label : RHASH5 , rhash : $RHASH5 , msatoshi : $HTLC_AMOUNT, complete : false } ] " ] |
|
|
|
# Pay correctly. |
|
|
|
lcli1 sendpay "$ROUTE" $RHASH5 |
|
|
|
|
|
|
@ -1095,7 +1095,7 @@ if [ ! -n "$MANUALCOMMIT" ]; then |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
[ "`lcli3 listinvoice RHASH5 | tr -s '\012\011\" ' ' '`" = "{ [ { label : RHASH5 , rhash : $RHASH5 , msatoshi : $HTLC_AMOUNT, complete : true } ] } " ] |
|
|
|
[ "`lcli3 listinvoice RHASH5 | tr -s '\012\011\" ' ' '`" = "[ { label : RHASH5 , rhash : $RHASH5 , msatoshi : $HTLC_AMOUNT, complete : true } ] " ] |
|
|
|
|
|
|
|
[ "`lcli3 waitinvoice | tr -s '\012\011\" ' ' '`" = "{ label : RHASH5 , rhash : $RHASH5 , msatoshi : $HTLC_AMOUNT } " ] |
|
|
|
|
|
|
|