feechange: fix db updates.

Found by PVS Studio.

Reported-by: Jon Griffiths <jgriffiths@blockstream.io>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2016-11-01 21:33:27 +10:30
parent fa402aac31
commit c1d6df58aa

View File

@ -135,7 +135,7 @@ void feechange_changestate(struct peer *peer,
|| newstate == SENT_FEECHANGE_COMMIT) || newstate == SENT_FEECHANGE_COMMIT)
db_new_feechange(peer, f); db_new_feechange(peer, f);
else if (newstate == RCVD_FEECHANGE_ACK_REVOCATION else if (newstate == RCVD_FEECHANGE_ACK_REVOCATION
|| SENT_FEECHANGE_ACK_REVOCATION) || newstate == SENT_FEECHANGE_ACK_REVOCATION)
db_remove_feechange(peer, f, oldstate); db_remove_feechange(peer, f, oldstate);
else else
db_update_feechange_state(peer, f, oldstate); db_update_feechange_state(peer, f, oldstate);