This commit fixes an existing, unnoticed bug within the lnwire. NewChanIDFromOutPoint function. Two lingering issues cause the function to not do anything at all, meaning that the channel ID, would be the exact same as the actual txid passed in. The first issue was that the xorTxid function wasn’t actually XOR’ing the last two bytes. This was due to the fact that the function wasn’t taking a pointer to the target ChannelID, meaning that the mutation wouldn’t be seen outside of the scope of the function. Second, we had our slicing reversed, rather than buf[30:], we were using buf[:30], meaning that we were weren’t properly filling the buffer with the lower 2-bytes of the passed index.
lnwire
The lnwire package implements the Lightning Network wire protocol.
This package has intentionally been designed so it can be used as a standalone package for any projects needing to interface with lightning peers at the wire protocol level.
Installation and Updating
$ go get -u github.com/lightningnetwork/lnd/lnwire