This commit modifies most of the wire messages to uniquely identify any
*active* channels by their funding output. This allows the wire
protocol to support funding transactions which open several channels in
parallel.
Any pending channels created by partial completion of the funding
workflow are to be identified by a uint64 initialized by both sides as
follows: the initiator of the connection starts from 0, while the
listening node starts from (1 << 63). These pending channel identifiers
are expected to be monotonically increasing with each new funding
workflow between two nodes. This identifier is volatile w.r.t to each
connection initiation.
* Added description in lnwire/README.md for state machine
* Figured out mutex stuff...
* Started the State Machine (using dummy functions for net/db)
* Minor corrections in wire protocol (changed some names/types)
- Renamed StagingID to HTLCKey of type HTLCKey (uint64)
* Structs and wire messages for HTLCs
* Wire protocol for a state machine with no blocking(!!!)
(I will write the state machine)
TL;DR: Can do multiple HTLC modifications in-flight, dead simple wire
protocol. Both sides can update their Commitments unliaterally without
waiting for the other party's signature. Will have basic/preliminary
notes in the README
* Added **swp to .gitignore because of vim annoyances
* FundingSignAccept and FundingSingComplete had *[]btcec.Signature and
instead it's now []*btcec.Signature to match other slice types.
* Refactored lnwire's when doing readElement/writeElement on slices
Running "go test -v" will show the serialization and deserialization.
Doing the rest of the wire stuff should be *much* faster since I figured
everything out...