Commit Graph

4304 Commits

Author SHA1 Message Date
7da8cb2910 lnwallet: add new TestNewBreachRetributionSkipsDustHtlcs test 2018-04-05 16:20:22 -07:00
f79af461d3 lnwallet: in NewBreachRetribution create the htlcRetributions slice to capacity, not length
In this commit, we fix an existing bug in the NewBreachRetribution
method. Rather than creating the slice to the proper length, we instead
now create it to the proper _capacity_. As we'll now properly filter out
any dust HTLCs, before this commit, even if no HTLCs were added, then
the slice would still have a full length, meaning callers could actually
interact with _blank_ HtlcRetribution structs.

The fix is simple: create the slice with the proper capacity, and append
to the end of it.
2018-04-05 16:19:49 -07:00
406fdbbf64 brontide: increase timeout to 5s 2018-04-05 15:54:47 -07:00
d6b9907cf5 Merge pull request #1014 from bretton/master
Correcting install docs to add path for upgrade instructions section
2018-04-05 10:15:34 +02:00
c393475d39 lnwallet: ensure that we skip dust HTLC's in NewBreachRetribution 2018-04-04 18:41:38 -07:00
4e44528bff lnwallet: fix ordering of keys when we generate the sender script during a breach
In this commit, we fix an existing within lnd. Before this commit,
within NewBreachRetribution the order of the keys when generating the
sender HTLC script was incorrect. As in this case, the remote party is
the sender, their key should be first. However, the order was swapped,
meaning that at breach time, our transaction would be rejected as it had
the incorrect witness script.

The fix is simple: swap the ordering of the keys. After this commit, the
test extension added in the prior commit now passes.
2018-04-04 18:41:37 -07:00
e91dff44e6 test: extend testRevokedCloseRetributionRemoteHodl to have HTLCs in both directions
In this commit, we extend the testRevokedCloseRetributionRemoteHodl so
that the final broadcast revoked transaction has incoming *and* outgoing
HTLC's. As is, this test fails as there's a lingering bug in the way we
generate htlc resolutions. A follow up commit will remedy this issue.
2018-04-04 18:41:33 -07:00
ca9174e166 peer: extend SendMessage to allow callers to block until msg is sent 2018-04-04 17:43:57 -07:00
b3bc374ba1 htlcswitch: send a direct Error if we get a known channel error on validate commit 2018-04-04 17:41:47 -07:00
1c5d62a804 lnwallet: add new concrete error InvalidHtlcSigError for failed htlc sig validation
In this commit we add a new error: InvalidHtlcSigError. This error will
be returned when we're unable to validate an HTLC signature sent by the
remote party. This will allow other nodes to more easily debug _why_ the
signature was rejected.
2018-04-04 17:41:10 -07:00
0dbd325fd0 htlcswitch: synchronously send the error to the peer on commitment verify fail
In this commit, we fix a slight bug in lnd. Before this commit, we would
send the error to the remote peer, but in an async manner. As a result,
it was possible for the connections to be closed _before_ the error
actually reached the remote party. The fix is simple: wait for the error
to be returned when sending the message. This ensures that the error
reaches the remote party before we kill the connection.
2018-04-04 17:38:35 -07:00
f53a99e18e htlcswitch: modify the SendMessage method on the Peer interface to optionally block
In this commit, add a new argument to the SendMessage method to allow
callers to request that the method block until the message has been sent
on the socket to the remote peer.
2018-04-04 17:36:44 -07:00
16ad6aed09 aezeed: add README with the text of the PR 2018-04-04 15:39:47 +02:00
0c7451c97c aezeed: add test vectors and test birthday calculation 2018-04-04 15:38:37 +02:00
ed6682ea4a multi test: make mock adhere to api change 2018-04-03 22:04:02 +02:00
6b6a616b1e chainntfnfs test: add testSpendNotificationMempoolSpends for btcd backend
The test is only run for the btcd backend for now, as notifying on
mempool spends doesn't work for neutrino and bitcoind.
2018-04-03 11:24:08 +02:00
a36683e5e0 chainntfnfs test: check spend notification only on confirmation
This commit changes the chainntnfs tests to adhere to the new
RegisterSpendNtfn signature. It also makes sure that for the test
testSpendNotification, we are only getting notified when a spend is
mined, as previously btcd would notify on mempool inclusion, while
neutrino and bitcoind would notify only on confirmation, and the test
wouldn't catch this.
2018-04-03 11:24:07 +02:00
8b02064c7b multi: provide mempool=true to RegisterSpendNtfn 2018-04-03 11:24:07 +02:00
9e7e023194 chainntnfs/bitcoind: add bool to RegisterSpendNtfn 2018-04-03 11:24:07 +02:00
5283b6d210 chainntnfs/neutrino: add bool to RegisterSpendNtfn 2018-04-03 11:24:07 +02:00
cc17bc1636 chainntnfs/btcd: add logic for mempool argument to RegisterSpendNtfn
This commit adds a boolean to RegisterSpendNtfn, giving the caller the
option to only register for notifications on confirmed spends. This is
implemented for the btcd backend using logic similar to what is in used
for Neutrino, paving the way for later unifying them.
2018-04-03 11:24:07 +02:00
fa29adf9a3 chainntnfs interface: add mempool argument to RegisterSpendNtfn 2018-04-03 11:24:07 +02:00
93a5a92243 adding missing cd-to-path for upgrade instructions 2018-04-03 11:19:07 +02:00
fca0df28e9 htlcswitch: fix periodic calculation of satoshis sent/received
In this commit, we fix an issue where users would be displayed negative
amounts of satoshis either as sent or received. This can happen if the
total amount of channel updates decreases due to channels being closed.

To fix this, we properly handle a negative difference of channel
updates by updating the stats logged to only include active
channels/links to the switch.
2018-04-02 21:23:55 -04:00
6fa93a78c1 lnd+lncli: bump version to 0.4.1 v0.4.1-beta 2018-04-02 17:08:39 -07:00
47a1d3f9e5 Merge pull request #955 from halseth/neutrinonotify-epoch-queue
[small] neutrinonotify: use epochqueue to notify block epochs
2018-04-02 16:23:14 -07:00
000e77f36c docs+README: update docs to no longer imply that only btcd is support
In this commit, we modify the docs in order to clarify that both btcd
and bitcoind are supported as chain backends. Many users expressed
confusion as the old set of docs stated that we "require" my btcd fork,
rather than clarifying that *if* you want to use btcd, then you must use
my fork.
2018-04-02 16:19:21 -07:00
b422e4ec1e lnwallet+funding+lnd: add new config option for min accepted channel size
In this commit we add a new command line option (and a sane default) to
allow users to specify the *smallest* inbound channel that they'll
accept. Having a higher-ish limit lets users limit their channels, and
also avoid a series of very low value "spam" channels.

The new option is --minchansize, and expressed in satoshis. If we
receive an inbound channel request for a value smaller than this, then
we'll immediately reject it.
2018-04-02 16:17:58 -07:00
de0a2ee49b server: don't directly mutate net.TCPAddr for inbound connections to set peer port
In this commit, we fix a minor logging bug introduced in a prior commit.
Before we would directly modify the *net.TCPAddr that was a part of the
brontide connection. This achieved our goal, but would print weird log
messages as we mutated the port in the already established connection.

In this commit, we fix that by ensuring we create a copy iff it's a
net.TCPAddr, then modify that and replace the instance in the
lnwire.NetAddress.

Fixes #991.
2018-04-02 16:14:33 -07:00
5984cbd4ff htlcswitch: allow overpaying for incoming payments
In this commit, we relax the constraints on accepting an exit hop
payment a bit. We'll now accept any incoming payment that _at least_
pays the invoice amount. This puts us further inline with the
specification, which recommends that nodes accept overpayment by a
certain margin.

Fixes #1002.
2018-04-02 15:58:56 -07:00
d82f67cc1d brontide: decrease handshake timeout to 1s 2018-04-02 15:56:47 -07:00
138da98df6 Merge pull request #992 from cfromknecht/makefile-docs
Makefile docs
2018-04-02 15:46:36 -07:00
8f08983fda Merge pull request #1001 from cfromknecht/brontide-async-handshake
brontide/listener: make handshake asynchronous
2018-04-02 15:38:26 -07:00
c22b46d462 brontide/noise_test: test parallel handshakes 2018-04-02 12:51:44 -07:00
782a8088eb brontide/listener: allow parallel handshakes 2018-04-01 15:49:31 -07:00
7bc9dbc3ea docs/MAKEFILE: Add default and all commands 2018-03-31 19:14:45 -07:00
872d06e035 docs/INSTALL: Update installation with Makefile cmds 2018-03-31 19:14:39 -07:00
29f1fda60d rpcserver: include a pending_open_balance in channelbalance response
Changes in `ChannelBalance` rpcserver method implementation to
add `pending_open_balance` counted according state of opened channel
2018-04-01 02:40:50 +03:00
66224e6bf8 lnrpc: add new pending_open_balance param to ChannelBalanceResponse
Changes in gRPC `channelbalance` service response message
of adding `pending_open_balance` parameter with sum of
channels open pending balances denominated in satoshis
2018-04-01 02:38:04 +03:00
9b729654f6 server: remove all pending conn reqs within DisconnectPeer 2018-03-31 16:26:19 -07:00
48982015fe build: commit latest inputs-digest for dep 2018-03-31 16:25:41 -07:00
72e59077ba makefile: update install directive to just use go install 2018-03-31 16:25:21 -07:00
29c9d78c63 Merge pull request #965 from cfromknecht/makefile-fix-and-timeout
Switch to Makefile Build System
2018-03-31 16:09:59 -07:00
5cb1a84356 lnd: support space characters surrounding = in bitcoind configuration files
lnd can't detect bitcoind configuration if the config file has spaces around the = character, e.g.:
```
zmqpubrawblock = tcp://127.0.0.1:28332
zmqpubrawtx = tcp://127.0.0.1:28332
rpcuser = rpcuser
```
I had to dig into the source code to understand what was wrong.

This patch solves this problem, bitcoind's config parsing source code can be seen at https://github.com/bitcoin/bitcoin/blob/master/src/util.cpp
2018-03-31 16:06:00 -07:00
6be6b48e09 Merge pull request #840 from halseth/openchannel-csv-delay
Add CSV delay flag to openchannel
2018-03-31 16:05:08 -07:00
87333ba829 config: bind naked ports to localhost
If only a port is given as a config value for a listener we'll
default to only binding that port to localhost.
2018-03-31 16:00:56 -07:00
ffb1b65eca Merge pull request #982 from cfromknecht/server-conns
server: cleanup persistent connection retries
2018-03-31 15:56:29 -07:00
7db7c9c493 lnd: correct docs in WatchNewChannel 2018-03-31 02:00:06 -07:00
3eb53467e0 fundingmanager_test: init WatchNewChannel 2018-03-31 02:00:05 -07:00
517135dd9a lnd_test: use EnsureConnected in itests hot spots
Uses EnsureConnected when reconnecting nodes in:
 - switch offline delivery persistence
 - graph topology notifications
 - channel funding persistence
2018-03-31 02:00:05 -07:00