mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 05:12:45 +01:00
peer: don't segv if closing before anchor established.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
4c3370e023
commit
ba2854e835
@ -1013,6 +1013,9 @@ const struct htlc *peer_tx_revealed_r_value(struct peer *peer,
|
|||||||
|
|
||||||
bool committed_to_htlcs(const struct peer *peer)
|
bool committed_to_htlcs(const struct peer *peer)
|
||||||
{
|
{
|
||||||
|
/* This is only set after anchor established. */
|
||||||
|
if (!peer->cstate)
|
||||||
|
return false;
|
||||||
return tal_count(peer->cstate->a.htlcs) != 0
|
return tal_count(peer->cstate->a.htlcs) != 0
|
||||||
|| tal_count(peer->cstate->b.htlcs) != 0;
|
|| tal_count(peer->cstate->b.htlcs) != 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user