mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 21:35:11 +01:00
channeld/full_channel: fix incorrect reutrn from channel_rcvd_revoke_and_ack.
It was always returning false; it was supposed to return true if we had added pending changes. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
211791f6d2
commit
5fb4577890
@ -684,7 +684,7 @@ bool channel_rcvd_revoke_and_ack(struct channel *channel,
|
||||
status_trace("Received revoke_and_ack");
|
||||
change = change_htlcs(channel, LOCAL, states, ARRAY_SIZE(states),
|
||||
htlcs, "rcvd_revoke_and_ack");
|
||||
return change & HTLC_LOCAL_F_COMMITTED;
|
||||
return change & HTLC_LOCAL_F_PENDING;
|
||||
}
|
||||
|
||||
/* FIXME: We can actually merge these two... */
|
||||
|
@ -161,7 +161,7 @@ static const struct htlc **include_htlcs(struct channel *channel, enum side side
|
||||
ret = channel_sending_commit(channel, &changed_htlcs);
|
||||
assert(ret);
|
||||
ret = channel_rcvd_revoke_and_ack(channel, &changed_htlcs);
|
||||
assert(!ret);
|
||||
assert(ret);
|
||||
ret = channel_rcvd_commit(channel, &changed_htlcs);
|
||||
assert(ret);
|
||||
ret = channel_sending_revoke_and_ack(channel);
|
||||
@ -257,7 +257,7 @@ static void send_and_fulfill_htlc(struct channel *channel,
|
||||
ret = channel_sending_commit(channel, &changed_htlcs);
|
||||
assert(ret);
|
||||
ret = channel_rcvd_revoke_and_ack(channel, &changed_htlcs);
|
||||
assert(!ret);
|
||||
assert(ret);
|
||||
ret = channel_rcvd_commit(channel, &changed_htlcs);
|
||||
assert(ret);
|
||||
ret = channel_sending_revoke_and_ack(channel);
|
||||
@ -288,7 +288,7 @@ static void send_and_fulfill_htlc(struct channel *channel,
|
||||
ret = channel_sending_commit(channel, &changed_htlcs);
|
||||
assert(ret);
|
||||
ret = channel_rcvd_revoke_and_ack(channel, &changed_htlcs);
|
||||
assert(!ret);
|
||||
assert(ret);
|
||||
ret = channel_rcvd_commit(channel, &changed_htlcs);
|
||||
assert(ret);
|
||||
ret = channel_sending_revoke_and_ack(channel);
|
||||
|
Loading…
Reference in New Issue
Block a user