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:
Rusty Russell 2017-11-20 16:37:11 +10:30 committed by Christian Decker
parent 211791f6d2
commit 5fb4577890
2 changed files with 4 additions and 4 deletions

View File

@ -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... */

View File

@ -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);