Commit Graph

252 Commits

Author SHA1 Message Date
Olaoluwa Osuntokun 1e5949cfbb
lnwire: return more descriptive errors in DecodeFailure for onion errors 2017-09-12 17:55:25 +02:00
Dave Collins 42a263b29f wire: Correct fuzz test for MsgCommitSig.
This corrects the fuzz test in TestLightningWireProtocol for
MsgCommitSig to avoid creating an empty slice since the decoded message
only creates a slice when there are greater than zero signatures and an
empty slice is not considered equal to a nil slice under reflection.

This can be tested by running the TestLightningWireProtocol 1000 times
in a loop with and without this change.
2017-08-30 18:07:33 -07:00
Conner Fromknecht 6ffe33f01a lnw+ba+utxon+cdb: reverts OutPoint and TxOut encoding 2017-08-25 17:56:50 -07:00
Philip Hayes f0aa186a56 channeldb+utxonursery+lnwire: use lnwire's OutPoint,TxOut serialization 2017-08-25 17:56:50 -07:00
Olaoluwa Osuntokun 2b2a3714c1
multi: fix linter errors 2017-08-22 01:00:12 -07:00
Olaoluwa Osuntokun f47e7a9bf4
lnwire: update the ChannelAnnouncement message to match BOLT-0007 2017-08-22 00:52:07 -07:00
Olaoluwa Osuntokun e93197b303
lnwire: add a ChainHash field to ChannelUpdate
This commit adds a ChainHash field to the ChannelUpdate message in
order to ensure that we’re compatible with the recent change to
BOLT-0007.
2017-08-22 00:52:04 -07:00
Olaoluwa Osuntokun 50c679afa3
lnwire: eliminate the ErrorCode field within the Error message
This commit does away with the ErrorCode field in order to ensure that
we’re properly compatible with BOLT-0002. In the future the error code
field may be re-introduced as it’s much easier to check against an
internet error rather than interpret a byte slice describing the error.
2017-08-22 00:52:02 -07:00
Olaoluwa Osuntokun 29af6e6932
lnwire: shift fields in NodeAnnouncment to match recent BOLT-0007 changes
This commit modifies the NodeAnnouncement message to ensure that it
matches the current spec ordering. The spec was recently modified to
place the feature vector first to allow for future changes to the
fields to be forwards compatible.
2017-08-22 00:51:59 -07:00
Olaoluwa Osuntokun 96696ccd99
lnwire: update node alias type to respect utf8, use full 32 bytes 2017-08-22 00:51:56 -07:00
Olaoluwa Osuntokun 1d1f9f1724
lnwire: update onion error encoding/decoding to match BOLT-0004
This commit updates the encoding/decoding for the onion errors to
properly match BOLT-0004. This commit does to major things: we increase
the max message size to 256 bytes to account for recent modifications
to the ChannelUpdate message, and also fold in the error code into the
failure message encapsulation itself.
2017-08-22 00:51:53 -07:00
Olaoluwa Osuntokun b174ae80bf
lnwire: convert all relevant fields to use the MilliSatoshi type 2017-08-22 00:51:51 -07:00
Olaoluwa Osuntokun 05d05ac5ee
lnwire: introduce new lnwire.MilliSatoshi type
This commit adds a new type to the lnwire package: MilliSatoshi. A
milli-satoshi is simply 1/1000th of a satoshi, and will be used for all
internal accounting when sending payments, calculating fees, updating
commitment state, etc. Two helper methods are added: ToBTC(), and
ToSatoshis() to make manipulation of the values easy.
2017-08-22 00:51:48 -07:00
Olaoluwa Osuntokun 50d521ba8c
lnwire: add a case in MessageType.String() for UpdateFee 2017-08-22 00:51:46 -07:00
Olaoluwa Osuntokun 8cda421784
lnwire: add new error code for rejecting a channel that's too large 2017-08-07 16:31:22 -07:00
Olaoluwa Osuntokun de30c14aea
lnwire: update testing/quick tests to new wire message updates 2017-07-30 17:47:55 -07:00
Olaoluwa Osuntokun f7800709ba
lnwire: use %v instead of %x when printing length of oversized msg 2017-07-30 17:47:51 -07:00
Olaoluwa Osuntokun 53f45e8210
lnwire: update MessageType definition to include new funding messages 2017-07-30 17:47:48 -07:00
Olaoluwa Osuntokun 364a9a8059
lnwire: add a HtlcSigs field to the CommitSig message
This commit adds a new field to the CommitSig message: HtlcSigs. This
new field will house signatures for each of the HTLC’s on the newly
created commitment state. This addition allows us to implement the new
commitment transaction structure outlined within the specification
which modifies HTLC’s such that the claiming process is now a two-phase
process. The first state transitions an HTLC to the delay+claim state,
and the second state (after the delay has passed) allows the
broadcaster of the commitment transaction to sweep the HTLC’s.

Fixes #61.
2017-07-30 17:47:44 -07:00
Olaoluwa Osuntokun be67bd46cd
lnwire: add a case for a slice of signatures to readElement/writeElement
This commit modifies the readElement and writeElement functions to add
the capability of reading/writing a slice of btcec.Signature. This new
case is required for the upcoming commit which will modify the
CommitSig message to include a field which houses signatures of reach
HTLC on the commitment transaction.
2017-07-30 17:47:40 -07:00
Olaoluwa Osuntokun 7f36b70a4a
lnwire: add new single funder messages from specification
This commit adds the new set of single funder messages from the
specification. As a result, after this commit and a follow up, all of
our messages will directly line up with those that are detailed within
the specification.

The new set of funding messages are very similar to our prior ones,
aside from the main difference of the addition of several channel level
constraints that give nodes control over their exposure, throughput,
and other values.
2017-07-30 17:47:37 -07:00
Olaoluwa Osuntokun 2263a6a1b7
lnwire: modify RevokeAndAck to remove NextRevocationHash
This commit modifies the RevokeAndAck message in order to bring it more
in line with the current draft of the specification. The prior version
was based on a version that used a revocation hash for HTLC’s and a
revocation key for commitment outputs. The current commitment design
uses revocation keys uniformly throughout.
2017-07-30 17:47:33 -07:00
Olaoluwa Osuntokun b2d86bffc5
lnwire: remove deprecated single funding wire messages
This commit removes the original single funder wire messages as they’ve
now been deprecated by the new commitment and HTLC structure within the
latest draft of the specification.
2017-07-30 17:47:29 -07:00
Olaoluwa Osuntokun a04fa76a4c
lnwire+htlcswitch: minor grammatical, formatting fixes after error PR 2017-07-14 20:08:37 -07:00
Andrey Samokhvalov 46ba18db9b lnwire: add update_fail_malformed_htlc message
In this commit BOLT#4 specification message have been added to the
lnwire package. This messsage is needed in order to notify payment
sender that forwarding node unable to parse the onion blob.
2017-07-14 19:08:04 -07:00
Andrey Samokhvalov 98956bc2fe lnwire: add specification onion errors
In this commit onion routing error from BOLT#4 have been added, the
initial error construction have been splitted on two parts: The first
part which contains the actual data will reside inside the lnwire
package because it contains all necessary function to decode/encode
the data. The second part obfuscation and hmac checking will resides
inside the lighting-onion package because it requires the key
generation.
2017-07-14 19:08:04 -07:00
Olaoluwa Osuntokun 14832d8c09
lnwallet+lnwire: minor grammatical fixes after UpdateFee merge 2017-07-14 17:10:42 -07:00
Johan T. Halseth a3836d5241 lnwire: add update_fee message type. 2017-07-14 16:39:15 -07:00
Olaoluwa Osuntokun 1be4d67ce4
multi: run all test instances in parallel 2017-06-17 01:00:07 +02:00
Olaoluwa Osuntokun 319afb14f1
lnwire: update ChannelUpdate to latest spec change, min HTLC is 8-bytes 2017-06-16 22:46:36 +02:00
Olaoluwa Osuntokun 650ba7e1ca
lnwire: update OnionPacketSize for new onion payload format
This commit updates the OnionPacketSize constant in order to reflect
the size of the onion payload as a result of the recent changes to the
sphinx packet format in the specification.
2017-06-10 18:15:09 -07:00
Olaoluwa Osuntokun 5adbc7fae3
lnwire: reduce range of randomly generated features in testing.Quick case
This commit reduces the range of the number of randomly generated
features in order to speed up the run time of the integration tests a
bit.
2017-06-07 16:54:49 -07:00
Andrey Samokhvalov 3897343db1 lnwire: add message type description function 2017-05-31 11:06:08 -07:00
Andrey Samokhvalov b86409cdb3 htlcswitch: recreate hlcswitch from scratch
This commit gives the start for making the htlc manager and htlc switch
testable. The testability of htlc switch have been achieved by mocking
all external subsystems. The concrete list of updates:

1. create standalone package for htlc switch.
2. add "ChannelLink" interface, which represent the previous htlc link.
3. add "Peer" interface, which represent the remote node inside our
subsystem.
4. add htlc switch config to htlc switch susbystem, which stores the
handlers which are not elongs to any of the above interfaces.

With this commit we are able test htlc switch even without having
the concrete implementation of Peer, ChannelLink structures, they will
be added later.
2017-05-31 11:06:08 -07:00
Andrey Samokhvalov 84f94bdf4f lnwire: add reason to fail code conversion method 2017-05-31 11:06:08 -07:00
bryanvu 514760f529 peer: handling for channel shutdown messages
This commit changes the cooperative channel close workflow to comply
with the latest spec. This adds steps to handle and send shutdown
messages as well as moving responsibility for sending the channel close
message from the initiator to the responder.
2017-05-23 14:31:20 -07:00
bryanvu d7bb600c23 lnwire: adjusted coop close messages to comply with spec
Removed close_request and close_complete and replaced with shutdown and
closing_signed.
2017-05-23 14:31:20 -07:00
Olaoluwa Osuntokun b671a50157
lnwire: change the FeePerKb field to FeePerKw 2017-05-16 19:06:25 -07:00
Olaoluwa Osuntokun 1124b4556f
lnwire: fix serialization order of features+addresses in NodeAnnouncement
This commit fixes a deviant in the way we serialize and deserialize the
node announcement message from that which is currently in the spec.
Before this commit we reversed the order of features and addresses.
Instead, on the wire, features should come _before_ the addresses.

We also add a new temporary feature bit to ensure nodes that don’t
directly connect to each other if they don’t have this new update.
However, this will also partition any current tests nets when new nodes
join them as the digest signed has changed, therefore invalidating any
older messages.

Fixes #207.
2017-05-12 14:30:17 -07:00
Olaoluwa Osuntokun 994a3c10ca
brontide+lnwire: fix linter issues 2017-04-20 15:50:13 -07:00
Olaoluwa Osuntokun aa2ca81762
lnwire: modify ReadMessage to no longer return the total bytes read
This commit modifies ReadMessage to no longer return the total bytes
read as this value will now be calculated at a higher level. The
io.Reader that’s passed to ReadMessage is expected to contain the
_entire_ message rather than be a pointer into a stream that contains
the message itself.
2017-04-20 15:45:56 -07:00
Olaoluwa Osuntokun 08a95ead6a
lnwire: remove the CreditsAmount definition, will be replaced with MilliSat 2017-04-19 16:19:14 -07:00
Olaoluwa Osuntokun f4e8aa21b8
lnwire: enforce a max limit on an outpoint's index
This commit implements the constraint on an outpoint’s index as defined
within the specification.
2017-04-19 16:18:36 -07:00
Olaoluwa Osuntokun 89f4b1185e
lnwire: add a basic test for NetAddress 2017-04-19 16:17:29 -07:00
Olaoluwa Osuntokun e3686cbc69
lnwire: replace all wire msg tests with a single property-based test
This commit does away with all the old manual message equality tests
and replace it with a single property-based test that uses the
testing/quick package. This test uses a single scenario which MUST hold
for all the messages type and all possible messages generated for those
types. As a result we are able to do away with all the prior manually
generated test data as the fuzzer to scan the input space looking for a
message that violates the scenario.
2017-04-19 16:17:00 -07:00
Olaoluwa Osuntokun febc8c399a
lnwire: convert message parsing to use the new minimal type header
This commit abandons our old bitcoin inspired message header and
replaces it with the bare type-only message headers that’s currently
used within the draft specification. As a result the message header now
consists of only 2-bytes for the message type, then actual payload
itself. With this change, the daemon will now need to switch to a
purely message based wire protocol in order to be able to handle the
extra data that can be extended to arbitrary messages.
2017-04-19 16:13:15 -07:00
Olaoluwa Osuntokun 587300aa80
lnwire: use ReadFull instead of Read when parsing feature vectors
This commit fixes a bug lingering in the decoding of the feature
vectors which was masked by the prior method of reading the _entire_
message from the stream before parsing it. The issue was that
performing a zero-byte Read on an io.Reader that’s purely streaming
will result in an indefinite block. We fix this bug by properly using
io.ReadFull in this context.
2017-04-19 16:07:17 -07:00
Olaoluwa Osuntokun 9324a503c9
lnwire: allow up to 35-bytes in pkScripts to account for P2WSH 2017-04-19 16:04:46 -07:00
Olaoluwa Osuntokun 8081fab8fe
lnwire: remove unused types from readElement/writeElement 2017-04-19 16:04:27 -07:00
Olaoluwa Osuntokun f6b3c25f95
lnwire: on Message interface convert Command to MsgType
This commit modifies the Message interface to convert the Command
method to a MsgType method that uses a new set of message type for all
the defined messages. These new messages types nearly exactly match the
message types used within the current draft of the BOLT specifications.
2017-04-19 15:57:50 -07:00
Olaoluwa Osuntokun bcd142bc30
lnwire: reduce the max message payload to 65KB from 32MB
This commit reduces the max message payload to 65KB from 32MB in order
to better align ourselves with current draft of the BOLT
specifications.
2017-04-19 15:09:18 -07:00
Olaoluwa Osuntokun c8d978261b
lnwire: remove the Validate method from the Message interface
This commit revues the Validate method from the Message interface as
the method is no longer used and is a relic from an older version of
the codebase.
2017-04-19 15:03:51 -07:00
Olaoluwa Osuntokun 920fcf3392
lnwire: modify newAlias to no longer return an error 2017-04-19 14:59:22 -07:00
Olaoluwa Osuntokun 1b10db212e
lnwire: rename ChannelUpdateAnnouncement to ChannelUpdate 2017-04-17 16:20:21 -07:00
Olaoluwa Osuntokun bf7701cd62
features: add new feature bits to guard recent changes 2017-04-16 18:19:09 -07:00
Olaoluwa Osuntokun feec611531
lnwire+peer: implement new ping/pong messages and behavior
This commit implements the new ping/pong messages along with their new
behavior. The new set of ping/pong messages allow clients to generate
fake cover traffic as the ping messages tells the pong message how many
bytes to included and can also be padded itself.
2017-04-16 18:11:45 -07:00
Olaoluwa Osuntokun 83c72eb082
lnwire: place ping and pong in the correct files :p 2017-04-16 15:48:46 -07:00
Olaoluwa Osuntokun d17b11862b
lnwire: convert ErrorGeneric to Error
With this change we move one step closer to matching the wire protocol
currently defined within the spec.
2017-04-16 15:23:45 -07:00
Olaoluwa Osuntokun c06894a2e6
lnwire: replace ChannelPoint with ChannelID, use new PendingChanID 2017-04-16 15:22:27 -07:00
Olaoluwa Osuntokun 8147151fbf
lnwire: add new 32-byte persistent/pending channel ID's
This commit does to things: moves the prior ShortChannelID struct into
a new short_channel_id.go file, and also implements the new ChannelID’s
currently used within he specification.

These new ID’s are 32-bytes in length and used during initial channel
funding as well as during normal channel updates. During initial
channel funding, the ID is to be a random 32-byte string, while once
normal channel operation has began, the ID is to be (txid XOR index),
where index is the index of the funding outpoint.
2017-04-16 15:19:45 -07:00
Andrey Samokhvalov c3b2854428 lnwire: converge discovery part of messages with specification
Change the name of fields of messages which are belong to the discovery
subsystem in a such way so they were the same with the names that are
defined in the specification.
2017-03-29 19:49:05 -07:00
Andrey Samokhvalov 54b3541707 lnwire: add specification 'AnnounceSignature' message
In this commit announcement signature message has been added which is
needed when peers want to announce their channel to the rest of the
network. This message acts as half proof carrier, nodes exchanges
their half proofs with each other and after that they are able to
construct the full proof.
2017-03-29 19:49:05 -07:00
Andrey Samokhvalov c174141a72 lnwire: remove not working test
Validation of the announcements message has been removed and it will
be added in the discovery package latter.
2017-03-29 19:49:05 -07:00
Olaoluwa Osuntokun afe77853b7
server+lnwire: pre-allocate address slices 2017-03-29 19:00:31 -07:00
bryanvu 085b7333cb lnwire: add support for Features in NodeAnnouncement
Add support for Features in NodeAnnouncment according to spec.
2017-03-29 12:03:43 -07:00
bryanvu 9ffac9eae1 lnwire: update NodeAnnouncement to handle multiple addresses
This commit modifies address handling in the NodeAnnouncement struct,
switching from net.TCPAddr to []net.Addr. This enables more flexible
address handling with multiple types and multiple addresses for each
node. This commit addresses the first part of issue #131 .
2017-03-29 12:03:43 -07:00
Olaoluwa Osuntokun 6b3a258e86
multi: fix formatting issues in packge README's 2017-03-27 16:25:25 -07:00
Andrey Samokhvalov 9dfaca1632 linter: fix new warnings 2017-03-17 12:53:15 -07:00
Olaoluwa Osuntokun 0db384fd6b
lnwire: properly fold at 80-columns within features.go 2017-03-16 12:12:00 -07:00
Andrey Samokhvalov 61991a1c89 lnd: fix latest goclean.sh lint warning 2017-03-13 16:30:23 -07:00
Andrey Samokhvalov fd97a4bd19 lnd: partially fix golint warnings 2017-03-13 16:30:23 -07:00
Andrey Samokhvalov 143a6e01bb lnd: fix unconvert warnings 2017-03-13 16:30:23 -07:00
Andrey Samokhvalov 8fb54782e2 lnd: fix gosimple warnings 2017-03-13 16:30:23 -07:00
Olaoluwa Osuntokun da09f4dcc4
lnwire: modify newAlias to truncate alias strings if too long 2017-03-08 14:21:57 -08:00
Olaoluwa Osuntokun f881e0a356
lnwire: fix typo in ChannelUpdateAnnouncement, Mstat -> Msat 2017-03-08 14:20:14 -08:00
Olaoluwa Osuntokun 743de45c92
lnwire: rename Expiry to TimeLockDelta within ChannelUpdateAnnouncement
This commit modifies the ChannelUpdateAnnouncement to rename the Expiry
variable instead of TimeLockDelta as that is more descriptive of the
purpose of the attribute itself.
2017-03-05 22:43:57 -06:00
bryanvu 7048480a4a minor: fixed arbiter spelling and comment/error messages in funding rpc messages 2017-02-24 11:37:33 -08:00
bryanvu eb490b8833 lnwire: add FundingLocked message
When the funding transaction has been confirmed, the FundingLocked
message is sent by the peers to each other so that the existence of the
newly funded channel can be announced to the network.

This commit also removes the SingleFundingOpenProof message.
2017-02-24 11:37:33 -08:00
bryanvu e549a3f0ed fundingmanager: move final funding steps from wallet to funding manager.
Once a channel funding process has advanced to the point of broadcasting
the funding transaction, the state of the channel should be persisted
so that the nodes can disconnect or go down without having to wait for the
funding transaction to be confirmed on the blockchain.

Previously, the finalization of the funding process was handled by a
combination of the funding manager, the peer and the wallet, but if
the remote peer is no longer online or no longer connected, this flow
will no longer work. This commit moves all funding steps following
the transaction broadcast into the funding manager, which is available
as long as the daemon is running.
2017-02-24 11:37:33 -08:00
Olaoluwa Osuntokun 3a647869b6
lnwire: fix features_test.go to not reference removed .String() method 2017-02-22 16:01:42 -08:00
Olaoluwa Osuntokun f9b44567ed
lnwire: remove String() method from FeatureVector
This commit removes the String() method from the FeatureVector as it
can produce confusing output when revving a feature vector and not
knowing the strip mapping ahead of time.
2017-02-22 15:53:47 -08:00
Christopher Jämthagen 46d23919e7 lnwire: add serializing and deserializing for type [6]byte
and remove serialization for type [4]byte.
2017-02-22 15:46:59 -08:00
Christopher Jämthagen 97aa478ce1 channeldb: change [4]byte obsfucator to [6]byte in test 2017-02-22 15:46:59 -08:00
Christopher Jämthagen 3983e0693b lnwire: use [6]byte obsfucator 2017-02-22 15:46:59 -08:00
Olaoluwa Osuntokun 8024fd72f8
lnwire: create distinct type for UpdateFailHTLC failure reason
This commit creates a distint type for the opaque failure reason within
the UpdateFailHTLC message. This new type is needed as this is the only
variable length byte slice within the protocol and therefore requires a
length prefix in order to serialize/deserialize properly.
2017-02-21 01:43:36 -08:00
Olaoluwa Osuntokun 4aa7de7f58
lnwire: remove obsolete String() method from new wire messages 2017-02-21 01:43:34 -08:00
Olaoluwa Osuntokun ccbbcf389b
lnwire: directly embed the wire.OutPoint in all commitment update msgs 2017-02-21 01:42:35 -08:00
Olaoluwa Osuntokun 5330513c7b
lnwire: morph HTLCSettleRequest into UpdateFufillHTLC
This commit modifies the prior HTLCSettleRequest to more closely match
the UpdateFufillHTLC defined within the specification. The only
semantic change is the move from a slice of pre-images (for “multi-sig”
LN) to a single payment preimage.
2017-02-21 01:42:32 -08:00
Olaoluwa Osuntokun f1357e96b3
lnwire: morph CancelHTLC into UpdateFailHTLC, remove HTLCAddReject
This commit morphs the prior CancelHTLC into the new UpdateFailHTLC
message and also gets rid of the obsolete HLTCAddReject message while
we’re at it.

The primary change from the CancelHTLC message to the UpdateFailHTLC
message is that the CancelReason is now simply called Reason and that
it’s now an opaque encrypted set of bytes. With this update the failure
messages are now more flexible (they can even carry new
ChannelUpdate’s) and also don’t reveal the exact cause of failure to
intermediate nodes.
2017-02-21 01:42:29 -08:00
Olaoluwa Osuntokun ec02060c9f
lnwire: rename HTLCAddRequest to UpdateAddHTLC 2017-02-21 01:42:26 -08:00
Olaoluwa Osuntokun 8a63c83283
lnwire: morph CommitSignature into CommitSig
This commit renames and modifies the CommitSignature message to more
closely match the CommitSig message defined within the current set of
draft specifications.

The major change within the new message is that we now longer
explicitly specify the update log index of the remote node that this
signature covers. This is due to the fact the revocation message now
also double as acknowledgements of the remote parties recevied
commitment update messages.
2017-02-21 01:42:23 -08:00
Olaoluwa Osuntokun 9a61bb3ae1
lnwire: rename CommitRevocation to RevokeAndAck
This commit renames the prior CommitRevocation message to RevokeAndAck
in order to better align the set of wire messages implemented by the
`lnwire` message with those currently defined within the specification.
2017-02-21 01:42:09 -08:00
Andrey Samokhvalov ae15a193e2 lnwire+features: transition to the user friendly list of features 2017-02-21 01:25:05 -08:00
Andrey Samokhvalov 3dd619fb35 lnwire: Add BOLT#1 'init' message
'init' message is the first message reveals the features supported or required
by this node. Nodes wait for receipt of the other's features to simplify error
diagnosis where features are incompatible. This message will help negotioate the
the features which are supported by both sides.
2017-02-17 13:27:29 +08:00
Olaoluwa Osuntokun 384fe61e73
multi: fix `go vet` warnings throughout code base 2017-02-16 19:33:19 +08:00
Olaoluwa Osuntokun a658fabf48
funding: disallow channel creation before lnd is synced to the chain
This commit adds a new restriction around funding channels at the
daemon level: lnd nodes will not allow either the initiation or the
acceptance of a channel before the node is fully synced to the best
known chain.

This fixes a class of bug that arises when a new node joins the network
and either attempts to open a channel or has a channel extended to them
before the node is fully synced to the network.
2017-01-24 17:12:57 -08:00
Trevin Hofmann 40c7bac3aa multi: fix a variety of typos throughout the repo 2017-01-17 17:02:56 -08:00
Olaoluwa Osuntokun f82d957c90
lnwire+peer: introduce new error for unknown message type for forward compat
This commit adds a new error type to the `lnwire` package:
`UnknownMessage`. With this error we can catch the particular case of a
an error during reading that encounters a new or unknown message. When
we encounter this message in the peer’s readHandler, we can now
gracefully handle it by just skipping to the next message rather than
closing out the section entirely.

This puts us a bit closer to the spec, but not exactly as it has an
additional constraint that we can only ignore a new message if it has
an odd type. In a future release, we’ll modify this code to match the
spec as written.
2017-01-16 18:03:43 -08:00
Olaoluwa Osuntokun d884efea29
lnwire+lnd: Make Logging Messages Great Again
This commit modifies the login of sent/recv’d wire messages in trace
mode in order utilize the more detailed, and automatically generated
logging statements using pure spew.Sdump.

In order to avoid the spammy messages due to spew printing the
btcec.S256() curve paramter within wire messages with public keys, we
introduce a new logging function to unset the curve paramter to it
isn’t printed in its entirety. To insure we don’t run into any panics
as a result of a nil pointer defense, we now copy the public keys
during the funding process so we don’t run into a panic due to
modifying a pointer to the same object.
2017-01-14 17:52:18 -08:00
Trevin Hofmann a13ac90d46 multi: add link to LICENSE in README license badges (#100) 2017-01-12 16:31:08 -08:00