Rusty Russell
c1d1b360bf
daemon: add memcheck() in various places where we expect things to be initialized.
This just causes valgrind to warn sooner.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
862509637b
daemon: implement unilateral commit.
This is only for the simple case where there are no HTLCs.
We group the current commit information together in the struct;
this involves a trivial transform from peer->cur_commit_theirsig to
peer->cur_commit.theirsig.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
4e5ced4de2
daemon: don't crash on pkt_err
We're about to test it, for anchor timeout.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
168ed96b12
daemon: close command.
This performs a mutual close.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
b76858c1a1
daemon: implement HTLC expiry.
We do the simplest thing: a timer goes off, and we check all HTLCs for
one which has expired more than 30 seconds ago.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
1018823f97
daemon: HTLC expiry limits.
Don't accept an HTLC which is about to expire, nor one which will take
too long to expire.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
2346f6bf14
daemon: routefail command.
This should be renamed: it's actually any kind of after-the-fact failure.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
1e82799852
daemon: fulfillhtlc command
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
9efdbbb21b
peer: use funding.h's struct channel_htlc.
Instead of our own fields for the current htlc.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
fc4c94cb06
daemon: simple close support for the case of one side closing transaction.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
6bdaa5d1ca
daemon: newhtlc command.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
645958920e
peer: make_commit_txs() helper.
We need to call it in several places, so unify it into a single function.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
3c9fd4fbe6
daemon: code to open channel and watch anchor.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
ecbe671688
peer: keep current commit txs, anchor state, channel funding and their sig.
This lets us implement accept_pkt_anchor().
Also had to predeclare sha256 in commit_tx.h, revealed by the new
includes.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
12b9d39b76
daemon: store revocation hashes in the peer_visible_state structure.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
abc002ff15
daemon: add state.c.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago