Commit Graph

6891 Commits

Author SHA1 Message Date
Joost Jager
e486340106
cnct: use sweeper in commit resolver
Now that the sweeper is available, it isn't necessary anymore for the
commit resolver to craft its own sweep tx. Instead it can offer its
input to the sweeper and wait for the outcome.
2019-02-01 09:20:45 +01:00
Joost Jager
7b94d9adb0
routing: move payment session to separate file 2019-02-01 09:14:54 +01:00
Joost Jager
5c03a0db99
lnrpc: extract setting force close info to method 2019-02-01 09:10:17 +01:00
Joost Jager
288fc6f065
utxonursery: remove unused report fields 2019-02-01 09:10:10 +01:00
Joost Jager
9abe06f3c8
cnct: finish channel arbitrator in StateFullyResolved
Previously the arbitrator wasn't advanced to the final stage after
the last contract resolved.

Also channel arbitrator now does not ignore a log error anymore
unresolved contracts cannot be retrieved.
2019-02-01 09:10:04 +01:00
Conner Fromknecht
61e5a783e8
travis: use make travis-itest to perform linting 2019-01-31 23:47:15 -08:00
Olaoluwa Osuntokun
17fd5eef07
lnwire: ensure we're able to decode legacy FailUnknownPaymentHash
In this commit, we modify the decoding of the FailUnknownPaymentHash
message to ensure we're able to fully decode the legacy serialization of
the onion error. We do this by catching the `io.EOF` error as it's
returned when _no_ bytes are read. If this is the case, then only the
error type was serialized and not also the optional amount.
2019-01-31 22:20:41 -08:00
Olaoluwa Osuntokun
b7387a5972
Merge pull request #2570 from Roasbeef/local-features-fix
lnwire: ensure even/odd features have the same base name
2019-01-31 22:19:40 -08:00
Olaoluwa Osuntokun
5c434b17ff
lnwire: ensure even/odd features have the same base name
In this commit, we fix a bug in the way we defined our even/odd features
for a particular feature. The check for if a feature bit is part of a
pair assumes that the pair bit has the exact same name as the bit being
queried. The way we defined our feature map didn't take note of this
assumption, as a result, any attempts to require a new bit moving from
optional to required would fail since the bit would be found, but the
names differed.
2019-01-31 20:58:10 -08:00
Olaoluwa Osuntokun
5167b02312
Merge pull request #2500 from Roasbeef/mandatory-dlp
server: require the DLP bit for all incoming/outgoing connections
2019-01-31 20:14:15 -08:00
Conner Fromknecht
24dcd3c44e
peer+server: use server-wide writeBufferPool for peer write buffers 2019-01-31 19:21:36 -08:00
Conner Fromknecht
40c5e5e19f
lnpeer/write_buffer_pool_test: adds basic write buffer pool test 2019-01-31 19:21:35 -08:00
Conner Fromknecht
0670db2c3d
lnpeer/write_buffer_pool: adds write buffer pool 2019-01-31 19:21:34 -08:00
Conner Fromknecht
0118120f55
queue/gc_queue_test: adds unit tests for GCQueue 2019-01-31 19:21:32 -08:00
Conner Fromknecht
717672ad83
queue/gc_queue: adds GCQueue to back recyclable pools 2019-01-31 19:21:31 -08:00
Olaoluwa Osuntokun
55ed7769a5
Merge pull request #2514 from cfromknecht/add-wtmock-pkg
watchtower/multi: move MockSigner+MockPeer to wtmock
2019-01-31 19:13:47 -08:00
Olaoluwa Osuntokun
f98cc26a6f
Merge pull request #2513 from cfromknecht/add-base-reward
wtpolicy+wtwire+wtserver: add base reward
2019-01-31 19:13:31 -08:00
Conner Fromknecht
9d20ca4a51
Merge pull request #2495 from halseth/itest-dont-shadow-prederr
[trivial] lnd_test: don't shadow predErr
2019-01-31 18:26:11 -08:00
Conner Fromknecht
9fe284923a
watchtower/wtserver: read RewardBase from CreateSession 2019-01-31 18:17:35 -08:00
Conner Fromknecht
46a86a863a
wtwire/create_session: add RewardBase field to CreateSession 2019-01-31 18:17:35 -08:00
Conner Fromknecht
26f4131102
watchtower/wtpolicy: add RewardBase to Policy 2019-01-31 18:17:35 -08:00
Conner Fromknecht
43120fd08c
watchtower/multi: move MockSigner+MockPeer to wtmock 2019-01-31 18:16:02 -08:00
Olaoluwa Osuntokun
8b04cfbf12
Merge pull request #2531 from wpaulino/update-listinvoices-docs
lnrpc: update ListInvoices documentation
2019-01-31 17:26:06 -08:00
Olaoluwa Osuntokun
9a66ac396b
Merge pull request #2493 from halseth/tor-addr-sanity-check
Validate addresses before writing them to DB
2019-01-31 17:15:22 -08:00
Olaoluwa Osuntokun
948646b58b
Merge pull request #2481 from joostjager/move-input
multi: move input to separate package
2019-01-31 16:48:31 -08:00
Conner Fromknecht
245b76ab51
Makefile: lint all travis builds
Ensures we fail faster if the source code doesn't
pass the lint checks.
2019-01-31 15:36:56 -08:00
Olaoluwa Osuntokun
fc869d4a4c
Merge pull request #2558 from halseth/channel-restoration-old-format-fee-update
Channel restoration of old format fee update
2019-01-31 12:29:49 -08:00
Joost Jager
9e012ecc93
multi: move Input interface and related code
This commit is a step to split the lnwallet package. It puts the Input
interface and implementations in a separate package along with all their
dependencies from lnwallet.
2019-01-31 13:25:33 +01:00
Joost Jager
667474db75
lnwallet: move code to transactions files 2019-01-31 13:24:39 +01:00
Johan T. Halseth
47918bd6ce
lnwallet/channel: add restoration sanity check
To avoid more bugs slipping through where the logIndex is not set, we
panic to catch this. This was earlier done for Adds and the htlcCounter,
which did lead us to find the resulting retoration bug.
2019-01-31 09:24:50 +01:00
Johan T. Halseth
9a0f87fd8e
lnwallet/channel_test: add TestFeeUpdateOldDiskFormat
TestFeeUpdateOldDiskFormat tests that we properly recover FeeUpdates
written to disk using the old format, where the logIndex was not
written.
2019-01-31 09:24:50 +01:00
Johan T. Halseth
b593c1c7c7
lnwallet/channel: set logIndex for restored FeeUpdate
Earlier versions did not write the log index to disk for fee updates, so
they will be unset. To account for this we set them to to current update
log index.
2019-01-31 09:24:49 +01:00
Olaoluwa Osuntokun
1863dcef1f
Merge pull request #2371 from Roasbeef/static-chan-backups-channeldb
channeldb: prepatory modifications for full SCB implementation
2019-01-30 14:40:27 -08:00
Olaoluwa Osuntokun
8bd29de981
Merge pull request #2554 from Roasbeef/deprecate-htlc-amt-error
multi: deprecate IncorrectHtlcAmount
2019-01-30 14:14:09 -08:00
Johan T. Halseth
da42ad245f
funding: cap the max_htlc value at channel capacity
We are not longer validating the max_value_in_flight field set by the
remote peer, so it is not always less than the channel capacity anymore.
We therefore make sure to cap it before advertising it.
2019-01-30 09:05:01 +01:00
Olaoluwa Osuntokun
441307e8f7
Merge pull request #2561 from Roasbeef/lax-max-in-flight-verification
Revert "funding+lnwallet: ensure max_htlc_value_in_flight smaller tha…
2019-01-29 23:04:13 -08:00
Olaoluwa Osuntokun
b1b42dcfae
test: update error propagation test for new onion error change
In this commit, we update the error propagation test to ensure that the
proper HTLC amount is included for the `CodeUnknownPaymentHash` error.
2019-01-29 23:03:42 -08:00
Olaoluwa Osuntokun
c8518140ee
lnwire: update Error() method for FailUnknownPaymentHash to include amt 2019-01-29 23:03:35 -08:00
Olaoluwa Osuntokun
b4c5833325
Revert "fundingmanager_test: add TestFundingManagerRejectInvalidMaxValueInFlight"
This reverts commit eb618051208dbd8bb0c160001052b5cc36174888.
2019-01-29 18:31:04 -08:00
orbitalturtle
08750f180b multi: deprecate IncorrectHtlcAmount onion error
In this commit, we deprecate the `IncorrectHtlcAmount` onion error.
We'll still decode this error to use when retrying paths, but we'll no
longer send this ourselves. The `UnknownPaymentHash` error has been
amended to also include the value of the payment as well. This allows us
to worry about one less error.
2019-01-29 18:21:13 -08:00
Olaoluwa Osuntokun
b220c47ce7
Revert "funding+lnwallet: ensure max_htlc_value_in_flight smaller than capacity"
This reverts commit 4aa52d267f000f84caf912c62fc14a5b8e7cacb5.

It turns out that the other implementations set values for this field
which aren't based on the actual capacity of the channel. As a result,
we'll no reject most of their channel offerings, since they may offer a
value of a max `uint64` or something else hard coded that's above the
size of the channel. As a result, we're reverting this check for now to
maintain proper compatibility.
2019-01-29 17:58:04 -08:00
Conner Fromknecht
fd1bbe63cf
Merge pull request #2505 from cfromknecht/go-acc-coverage
build: more reliable coverage using go-acc
2019-01-29 12:45:28 -08:00
Olaoluwa Osuntokun
480ec3bbca
channeldb: ensure restored channels can't be mutated 2019-01-28 20:24:48 -08:00
Olaoluwa Osuntokun
4fd1f832d7
contractcourt+rpc: use new FetchChannel method instead of scanning
In this commit, we modify areas where we need to force close a channel
to use the new FetchChannel method instead of manually scanning. This
dramatically reduces the CPU usage when doing things like closing a
large number of channels within lnd.
2019-01-28 20:24:45 -08:00
Olaoluwa Osuntokun
821de3e107
test: remove FullSync call from breacharbiter_test.go
In this commit, we remove an extra openChannel.FullSync() call from
breacharbiter_test.go. Before this collective diff, calling
SyncPending() then FullSync() didn't result in an error. However, a
prior commit now makes this an error to ensure we don't attempt to
override any existing channels. This is the only area in the codebase
that we made this mistake which in this case, was benign.
2019-01-28 20:24:43 -08:00
Olaoluwa Osuntokun
9e5723e1bc
lnwallet: modify ForceClose to disallow closing if local data loss
In this commit, we ensure that if a channel is detected to have local
data loss, then we don't allow a force close attempt, as this may not be
possible, or cause us to play an invalid state.
2019-01-28 20:24:42 -08:00
Olaoluwa Osuntokun
b2b57314fa
channeldb: add new RestoreChannelShells method
In this commit, we add a new type (ChannelShell) along with a new
method, RestoreChannelShells which allows a caller to insert a series of
channel shells into the database. These channel shells will allow a
restored node to initiate the DLP protocol and recover their set of
existing channels.

When we insert a channel shell, we re-create the original link node, and
also add the outgoing edge to the channel graph. This way we can be sure
that upon start up, we attempt to connect to the remote peers, and that
the normal graph query commands will operate as expected.
2019-01-28 20:24:41 -08:00
Olaoluwa Osuntokun
fa30af0475
channeldb: when fetching/inserting commits check for ChanStatusRestored
If the ChanStatusRestored flag is set, then we don't need to write or
read the set of commits for a channel as they won't exist. This will be
the case when we restore a channel from an SCB.
2019-01-28 20:24:40 -08:00
Olaoluwa Osuntokun
c656788b0b
channeldb: add new methods to allow adding a new edge+policy w/ existing db transaction 2019-01-28 20:24:38 -08:00
Olaoluwa Osuntokun
11c6887ffa
channeldb: refactor syncPending to expose new syncNewChannel function
The new syncNewChannel function will allow callers to insert a new
channel given the OpenChannel struct, and set of addresses for the
channel peer. This new method will also create a new LinkNode for the
peer if one doesn't already exist.
2019-01-28 20:24:37 -08:00