mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-15 03:54:19 +01:00
channel: unwrap and send incoming HTLCs to master.
So far it just looks it up, marks it resolved, then does nothing. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -38,7 +38,7 @@ FUND_INPUT_TX=`$CLI getrawtransaction $FUND_INPUT_TXID`
|
||||
lcli1 addfunds $FUND_INPUT_TX | $FGREP '"satoshis" : 10000002'
|
||||
|
||||
# Now fund a channel.
|
||||
lcli1 fundchannel $ID2 100000
|
||||
lcli1 fundchannel $ID2 1000000
|
||||
|
||||
# Now wait for it to reach depth
|
||||
lcli1 getpeers info | $FGREP "Waiting for our funding tx"
|
||||
@@ -53,9 +53,22 @@ check "lcli2 getpeers | tr -s '\012\011\" ' ' ' | $FGREP 'condition : Normal ope
|
||||
SECRET=1de08917a61cb2b62ed5937d38577f6a7bfe59c176781c6d8128018e8b5ccdfd
|
||||
RHASH=`lcli1 dev-rhash $SECRET | sed 's/.*"\([0-9a-f]*\)".*/\1/'`
|
||||
|
||||
# This is actually dust
|
||||
lcli1 dev-newhtlc $ID2 100000 $(( $(blockheight) + 10 )) $RHASH
|
||||
check "lcli1 getlog debug | $FGREP 'Sending commit_sig with 0 htlc sigs'"
|
||||
|
||||
check "lcli2 getlog debug | $FGREP 'their htlc 0 locked'"
|
||||
check "lcli2 getpeers info | $FGREP 'failed htlc 0 code 0x400f'"
|
||||
|
||||
# This one isn't dust.
|
||||
RHASH=`lcli2 invoice 100000000 testpayment1 | get_field rhash`
|
||||
[ `lcli2 listinvoice testpayment1 | get_field complete` = false ]
|
||||
|
||||
lcli1 dev-newhtlc $ID2 100000000 $(( $(blockheight) + 10 )) $RHASH
|
||||
check "lcli1 getlog debug | $FGREP 'Sending commit_sig with 1 htlc sigs'"
|
||||
|
||||
check "lcli2 getlog debug | $FGREP 'Resolving invoice '\'testpayment1\'' with HTLC 1'"
|
||||
[ `lcli2 listinvoice testpayment1 | get_field complete` = true ]
|
||||
|
||||
lcli1 stop
|
||||
lcli2 stop
|
||||
|
||||
Reference in New Issue
Block a user