Fix various spec bugs, can now open channels with real nodes!
authorMatt Corallo <git@bluematt.me>
Thu, 19 Jul 2018 21:17:06 +0000 (17:17 -0400)
committerMatt Corallo <git@bluematt.me>
Thu, 19 Jul 2018 21:25:47 +0000 (17:25 -0400)
commitb02176c86bfa991a7c4856e427355d6e034e1eaa
tree1b492f4c2abb995ce8560467dc4d6de184dd5a58
parent73932d75dcf890f32a7992494a156b2f8e7def44
Fix various spec bugs, can now open channels with real nodes!

 * commitment transaction number, as used in locktime/sequence
   fields is actually different from commitment transaction number,
   as used for revocation state. This is confusing and never stated
   in the spec, so we have to do the conversion.
 * max_htlc_value_in_flight is never constrained in the spec, but
   we were requiring it be <= channel size. Instead just clamp the
   values the peer sends us when storing.
 * channel_id calculation was incorrect, we now do some crazy
   conversion hops, which we shouldn't, but will need to change our
   types to fix.
 * Our channel_reserve_satoshis value was too low, just change the
   constant and leave the TODO to figure out what it really should
   be for now.
src/chain/transaction.rs
src/ln/channel.rs
src/ln/channelmonitor.rs