Commit Graph

3989 Commits

Author SHA1 Message Date
Johan T. Halseth
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
Johan T. Halseth
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
Johan T. Halseth
8b02064c7b
multi: provide mempool=true to RegisterSpendNtfn 2018-04-03 11:24:07 +02:00
Johan T. Halseth
9e7e023194
chainntnfs/bitcoind: add bool to RegisterSpendNtfn 2018-04-03 11:24:07 +02:00
Johan T. Halseth
5283b6d210
chainntnfs/neutrino: add bool to RegisterSpendNtfn 2018-04-03 11:24:07 +02:00
Johan T. Halseth
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
Johan T. Halseth
fa29adf9a3
chainntnfs interface: add mempool argument to RegisterSpendNtfn 2018-04-03 11:24:07 +02:00
Bretton Vine
93a5a92243 adding missing cd-to-path for upgrade instructions 2018-04-03 11:19:07 +02:00
Wilmer Paulino
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
Olaoluwa Osuntokun
6fa93a78c1
lnd+lncli: bump version to 0.4.1 2018-04-02 17:08:39 -07:00
Olaoluwa Osuntokun
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
Olaoluwa Osuntokun
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
Olaoluwa Osuntokun
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
Olaoluwa Osuntokun
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
Olaoluwa Osuntokun
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
Olaoluwa Osuntokun
d82f67cc1d
brontide: decrease handshake timeout to 1s 2018-04-02 15:56:47 -07:00
Olaoluwa Osuntokun
138da98df6
Merge pull request #992 from cfromknecht/makefile-docs
Makefile docs
2018-04-02 15:46:36 -07:00
Olaoluwa Osuntokun
8f08983fda
Merge pull request #1001 from cfromknecht/brontide-async-handshake
brontide/listener: make handshake asynchronous
2018-04-02 15:38:26 -07:00
Conner Fromknecht
c22b46d462
brontide/noise_test: test parallel handshakes 2018-04-02 12:51:44 -07:00
Conner Fromknecht
782a8088eb
brontide/listener: allow parallel handshakes 2018-04-01 15:49:31 -07:00
Conner Fromknecht
7bc9dbc3ea
docs/MAKEFILE: Add default and all commands 2018-03-31 19:14:45 -07:00
Conner Fromknecht
872d06e035
docs/INSTALL: Update installation with Makefile cmds 2018-03-31 19:14:39 -07:00
Vadym Popov
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
Vadym Popov
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
Olaoluwa Osuntokun
9b729654f6
server: remove all pending conn reqs within DisconnectPeer 2018-03-31 16:26:19 -07:00
Olaoluwa Osuntokun
48982015fe
build: commit latest inputs-digest for dep 2018-03-31 16:25:41 -07:00
Olaoluwa Osuntokun
72e59077ba
makefile: update install directive to just use go install 2018-03-31 16:25:21 -07:00
Olaoluwa Osuntokun
29c9d78c63
Merge pull request #965 from cfromknecht/makefile-fix-and-timeout
Switch to Makefile Build System
2018-03-31 16:09:59 -07:00
Laurent Raufaste
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
Olaoluwa Osuntokun
6be6b48e09
Merge pull request #840 from halseth/openchannel-csv-delay
Add CSV delay flag to openchannel
2018-03-31 16:05:08 -07:00
Matt Drollette
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
Olaoluwa Osuntokun
ffb1b65eca
Merge pull request #982 from cfromknecht/server-conns
server: cleanup persistent connection retries
2018-03-31 15:56:29 -07:00
Conner Fromknecht
7db7c9c493
lnd: correct docs in WatchNewChannel 2018-03-31 02:00:06 -07:00
Conner Fromknecht
3eb53467e0
fundingmanager_test: init WatchNewChannel 2018-03-31 02:00:05 -07:00
Conner Fromknecht
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
Conner Fromknecht
fa6271c8d4
travis: update to use make travis 2018-03-31 01:59:02 -07:00
Conner Fromknecht
5335c960f3
gotest: build local binaries for itests 2018-03-31 01:59:01 -07:00
Conner Fromknecht
c1389a5388
lntest: execute locally compiled binary 2018-03-31 01:59:01 -07:00
Conner Fromknecht
47aa56aad9
make/testing_flags: adds testing flags for targeting 2018-03-31 01:59:01 -07:00
Conner Fromknecht
1a36a2b1cb
Makefile: fix tab expansion and add timeout config 2018-03-31 01:59:01 -07:00
Conner Fromknecht
0449c0d50b
lntest/node: advertise external IP in itests 2018-03-31 00:51:13 -07:00
Conner Fromknecht
0d8f4f4be4
lntest/harness: harden ConnectEnsure
Alters the behavior of ConnectEnsure to initiate a connection
attempt in both directions. Additionally, the wait predicate only
returns true after cross checking both peer lists.
2018-03-31 00:51:12 -07:00
Conner Fromknecht
2490b9b6e3
server: cleanup persistent connection retries
This commits changes the behavior of our connection
reestablishment, and resolves some minor issues that
could lead to uncancelled requests or an infinite
connection loop.

 - Will not attempt to Remove connection requests with
   an ID of 0. This can happen for reconnect attempts
   that get scheduled, but have not started at the
   time the server cancels the connection requests.

 - Adds a per-peer cancellation channel, that is
   closed upon a successful inbound or outbound
   connection. The goroutine spwaned to handle the
   reconnect by the peerTerminationWatch now
   selects on this channel, and skips reconnecting
   if it is closed before the backoff matures.

 - Properly computes the backoff when no entry in
   persistentPeersBackoff is found. Previously, a
   value of 0 would be returned, cause all subsequent
   backoff attempts to use a backoff of 0.

 - Cancels a peers retries and remove connections
   immediately after receiving an inbound connection,
   to mimic the structure of OutboundPeerConnected.

 - Cancels all persistent connection requests after
   calling DisconnectPeers.

 - Allow additional connection attempts to peers, even if
   there already exists a pending connection attempt.
2018-03-31 00:51:12 -07:00
Olaoluwa Osuntokun
4480052cd6
server: ensure a default backoff is always used 2018-03-30 19:11:12 -07:00
Olaoluwa Osuntokun
956d20ebdc
funding+lnd: ensure we reconnect to new channel peers
In this commit, we fix a minor bug in the prior versions of lnd. Before
this commit, if we received a new inbound connection for channel
creation, the channel was created, and then the peer disconnected, we
wouldn't automatically reconnect.

In this commit we fix this issue by overloading the WatchNewChannel
method to also accept the peer's ID so we can add it to the set of
persistent connections.
2018-03-30 18:42:40 -07:00
Olaoluwa Osuntokun
d34c37f3dd
server: when constructing peer addr's attempt to locate proper port, fallback to default port
In this commit, we fix an existing bug within the codebase: if a peer
connected to us inbound, then we'd attempt to use the assigned port when
re-establishing a connection to them. We fix this issue in this commit
by adding a new method to look up any advertisements for the peer, and
use the specified port that matches our connection attempt. If we can't
find a proper advertisement, then we'll simply use the default peer
port.
2018-03-30 15:59:11 -07:00
Olaoluwa Osuntokun
71b8195ad0
funding: remove old TODO 2018-03-30 15:57:19 -07:00
Olaoluwa Osuntokun
b2e1d6988c
server: don't immediately add bootstrap peer to set of persistent connections 2018-03-30 15:16:18 -07:00
Olaoluwa Osuntokun
2526827b6d
test: modify sphinx replay test to force close the final channel
In this commit, we modify the sphinx replay test to actually force close
that final channel. We do this, as otherwise, we'll now reject the co-op
close attempt as the channel still has active HTLCs.
2018-03-30 14:53:05 -07:00
Olaoluwa Osuntokun
8d71ed2f64
lnwire: return pointer to ErrUnknownAddrType to ensure type switch in peer.go catches it
Related to #979.
2018-03-30 14:26:09 -07:00