Document+check commitment_signed generation success on send_htlc
authorMatt Corallo <git@bluematt.me>
Wed, 5 Sep 2018 18:08:38 +0000 (14:08 -0400)
committerMatt Corallo <git@bluematt.me>
Wed, 5 Sep 2018 23:47:01 +0000 (19:47 -0400)
commit8e4c062f1b5aacc1fb98b52537a7a98b6194c6b4
tree31eea207b6a5c0bd13af7b59f8e2d2a28d2b9129
parenteeefdaf7a2d150ff89ec0ce11da1bbe7b98816bb
Document+check commitment_signed generation success on send_htlc

Because we don't have an HTLCState for
update_add_htlc-generated-but-not-yet-commitment_signed to simplify
the mess of HTLCState match arms, any time a Channel::send_htlc
call returns Ok(Some(_)) we MUST call commitment_signed and it MUST
return success (or close the channel). We mention this in the docs
and panic if its not met in ChannelManager (which lets the fuzz
tester check this).
src/ln/channel.rs
src/ln/channelmanager.rs