peer: implement committed_to_htlcs().

Simply count how many HTLCs are in our current funding state.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2016-01-22 06:45:28 +10:30
parent 9efdbbb21b
commit e1f772a443

View File

@@ -674,8 +674,8 @@ const struct htlc *peer_tx_revealed_r_value(struct peer *peer,
bool committed_to_htlcs(const struct peer *peer)
{
/* FIXME */
return false;
return tal_count(peer->cstate->a.htlcs) != 0
|| tal_count(peer->cstate->b.htlcs) != 0;
}
/* Create a bitcoin close tx. */