Commit Graph

4545 Commits

Author SHA1 Message Date
Olaoluwa Osuntokun
b9947c1c7c
Merge pull request #1578 from Roasbeef/invoice-ntfn-buffer
invoiceregistry: make the invoice ntfn chan buffered
2018-07-20 18:12:00 -07:00
Olaoluwa Osuntokun
271db7d06d
Merge pull request #1505 from wpaulino/fundingmanager-send-peer-directly
fundingmanager: send messages directly to peers
2018-07-20 17:48:14 -07:00
Wilmer Paulino
d54d41eed7
fundingmanager: update tests to latest changes 2018-07-19 12:34:13 -07:00
Wilmer Paulino
38e01b259f
fundingmanager+lnd: remove no longer needed FindPeer and SendToPeer
callbacks

The FindPeer and SendToPeer callbacks are no longer needed within the
fundingManager due to the previous commit allowing us to send messages
to peers directly.
2018-07-19 12:34:12 -07:00
Wilmer Paulino
9cedef9245
fundingmanager: send messages to peers directly
In this commit, we modify the existing message sending functionality
within the fundingmanager. Due to each mesage send requiring to hold the
server's lock to retrieve the peer, we might run into a case where the
lock is held for a larger than usual amount of time and would therefore
block on sending the message within the fundingmanager. We remedy this
by taking a similar approach to some recent changes within the gossiper.
We now keep track of each peer within the internal fundingmanager
messages and send messages directly to them.
2018-07-19 12:34:11 -07:00
Wilmer Paulino
e669e90017
fundingmanager: retrieve peer before resuming funding flow 2018-07-19 12:34:10 -07:00
Wilmer Paulino
6d4da72156
discovery/gossiper: update to latest NotifyWhenOnline changes 2018-07-19 12:34:08 -07:00
Wilmer Paulino
04c5eba194
server: modify NotifyWhenOnline to return the peer once connected 2018-07-19 12:32:32 -07:00
Wilmer Paulino
6504a9cfa8
fundingmanager+peer: modify fundingErrorMsg to use peer key 2018-07-19 12:32:31 -07:00
Wilmer Paulino
6b1982f50f
fundingmanager+lnd: modify WatchNewChannel callback to take in peer key 2018-07-19 12:32:30 -07:00
Wilmer Paulino
3ab17063ff
multi: satisfy new lnpeer interface 2018-07-19 12:32:29 -07:00
Wilmer Paulino
77d2853d76
lnpeer: extend interface Address and AddNewChannel methods 2018-07-19 12:32:28 -07:00
Wilmer Paulino
8c92df0f47
fundingmanager: return ErrFundingManagerShuttingDown on shutdown 2018-07-19 12:32:13 -07:00
Olaoluwa Osuntokun
10b0df61a7
Merge pull request #1577 from Roasbeef/invoice-duplicate-settle
channeldb: ensure that we return an invoice on duplicate settles
2018-07-17 17:44:26 -07:00
Olaoluwa Osuntokun
c965e0f4a9
invoiceregistry: make the invoice ntfn chan buffered
In this commit, we update the main invoiceEvents channel within the
invoiceregistry to now have an initial buffer size of 100. We do this as
it's been reported by users that on start up they're unable to actually
create or settle invoices manually. Traces have shown that this is due
to contention while holding the invoice mutex. To attempt to solve this,
we add an additional buffer to the channel as most sends will now be
routinely non blocking.
2018-07-17 16:53:28 -07:00
Olaoluwa Osuntokun
daf4a25fd9
discovery: fix missing formatting argument
Fixes #1576.
2018-07-17 16:43:06 -07:00
Olaoluwa Osuntokun
5ee368f0f9
channeldb: ensure that we return an invoice on duplicate settles
In this commit, we fix an existing bug related to duplicate invoice
settle.s Before this commit, the second (and later) times an invoice was
settled we would return a nil pointer. This would result in the new
invoiceRegistry panicing as it would go to attempt to notify with a nil
invoice.

We fix this by returning the invoice on disk (unmodified) for each
settle after the initial one.

Fixes #1568.
2018-07-17 16:28:08 -07:00
Olaoluwa Osuntokun
509998db86
channeldb: add new test for duplicate invoice settles
In this commit, we add a new test to ensure that duplicate invoice
settles work as expected. At the present time, this test will fail as
the second to last assertion fails as we'll return a nil invoice the
second time around.
2018-07-17 16:27:04 -07:00
Olaoluwa Osuntokun
6dff599d21
Merge pull request #1554 from halseth/bitcoind-mempool-spends
Filter out bitcoind mempool spends
2018-07-16 13:24:35 -07:00
Johan T. Halseth
07618ca0c6
chainntnfs/interface_test: increase wait time for mempool spends
This commit increases the time we wait for a spend client to notify a
mempool spend from 50ms to 10s. This is done to catch the case where
bitcoind would use up to 7 seconds before notifying about a mempool
spend, which wasn't caught by the test.
2018-07-16 15:08:59 +02:00
Johan T. Halseth
4e47e4e7f1
chainntnfs/bitcoindnotify: filter out mempool spends from relevant txs
This commit fix a bug within the bitcoind notifier logic, which would
ignore the passed mempool argument, and notify spentness whether the
spending transaction was confirmed or not. The logic used to fix this is
similar to what is already done for the btcd backend.
2018-07-16 12:27:05 +02:00
Olaoluwa Osuntokun
b0288d4677
Merge pull request #1326 from Roasbeef/btcsuite-switch
multi: switch over all imports to depend on btcsuite proper, no longer the roasbeef forks
2018-07-13 18:49:17 -07:00
Olaoluwa Osuntokun
71dfb1cdb1
build: update glide to point to latest neutrino+btcwallet 2018-07-13 17:15:13 -07:00
Olaoluwa Osuntokun
505544e1b3
routing/chainview: update API usage for neutrino due to recent changes 2018-07-13 17:15:12 -07:00
Olaoluwa Osuntokun
80ff2c8d9f
lnwallet+chainntnfs: update neutrino API usage due to recent changes 2018-07-13 17:15:12 -07:00
Olaoluwa Osuntokun
9ad9af4f7a
build: update glide files to point to btcsuite/* not roasbeef/* 2018-07-13 17:15:12 -07:00
Olaoluwa Osuntokun
a34a4661e8
docs: update installation instructions to point to btcsuite/btcd not roasbeef/btcd 2018-07-13 17:08:46 -07:00
Olaoluwa Osuntokun
054d449316
docker/btcd: fix comment in docker file w.r.t old roasbeef fork 2018-07-13 17:08:46 -07:00
Olaoluwa Osuntokun
584834aa95
makefile: update to fetch btcsuite/btcd instead of roasbeef/btcd 2018-07-13 17:08:45 -07:00
Olaoluwa Osuntokun
6f60f139f4 multi: switch over import paths from roasbeef/* to btcsuite/* 2018-07-13 17:05:39 -07:00
Olaoluwa Osuntokun
bc5bfeb479
lnwire: fix logging for FeeInsufficient, show amt not fee
Fixes #1548.
2018-07-12 16:10:16 -07:00
Olaoluwa Osuntokun
d8fb6017cc
Merge pull request #1547 from Roasbeef/outgoing-payment-migration-invoice-series
channeldb: add new migration to finalize invoice migration for outgoi…
2018-07-12 13:20:25 -07:00
Olaoluwa Osuntokun
19d84dd1cc
channeldb: add new migration to finalize invoice migration for outgoing payments
In this commit, we migrate the database away from a partially migrated
state. In a prior commit, we migrated the database in order to update
the Invoice struct with three new fields: add index, settle index, paid
amt.  However, it was overlooked that the OutgoingPayment struct also
embedded an Invoice within it. As a result, nodes that upgraded to the
first migration found themselves unable to start up, or call
listpayments, as the internal invoice within the OutgoignPayment hadn't
yet been updated.  This would result in an OOM typically as we went to
allocate a slice with a integer that should have been small, but may
have ended up actually being a set of random bytes, so a very large
number.

In this commit, we finish the DB migration by also migrating the
internal invoice within each OutgoingPayment.

Fixes #1538.
Fixes #1546.
2018-07-12 00:22:28 -07:00
Olaoluwa Osuntokun
515ba7a4d0
channeldb: fix formatting for invoice migration log 2018-07-11 17:05:56 -07:00
Olaoluwa Osuntokun
93207608b5
Merge pull request #1125 from Roasbeef/streaming-invoice-improvements
channeldb+lnrpc: re-work invoicing API to implement robust streaming notification delivery
2018-07-10 20:42:00 -07:00
Olaoluwa Osuntokun
1189e703da
invoiceregistry: enforce stricter check on duplicate ntfn avoidance 2018-07-10 19:37:24 -07:00
Olaoluwa Osuntokun
90d4a723d3
Merge pull request #1536 from cfromknecht/install-doc-formatting
docs/INSTALL: fix mismatched code blocks
2018-07-10 19:06:25 -07:00
Conner Fromknecht
a3acd9c23f
docs/INSTALL: fix mismatched code blocks 2018-07-10 19:03:06 -07:00
Rui Gomes
ae84b99cb5 cmd/lncli: add missing space to the payinvoice cmd help 2018-07-10 17:21:46 -07:00
Olaoluwa Osuntokun
16df90fc23
Merge pull request #1504 from cfromknecht/chainview-filter-locking
[routing/chainview] improve filter locking granularity in btcd/bitcoind
2018-07-10 17:19:36 -07:00
maurycy
3915c6a569 routing: do not reacquire the lock for topology notifications 2018-07-10 17:09:52 -07:00
jonny1000
273f030390 test: fix type in comment 2018-07-10 17:06:55 -07:00
maurycy
ee65605495 chainregistry: fix ActiveChains comment 2018-07-10 16:57:09 -07:00
Dan Bolser
d0d77f9718 README: add known good FreeBSD (9.11) instructions 2018-07-10 16:53:34 -07:00
Olaoluwa Osuntokun
a43d02f8f0
cmd/lncli: clarify help for push_amt in openchannel
Fixes #1522.

Fixes #1259.
2018-07-09 12:40:47 -07:00
Olaoluwa Osuntokun
e13f96e64b
routing: ensure we create a pruneViewSnapshot for route sessions
In this commit, we fix an existing bug that could at times lead to a
panic if a user manually crafts a route via SendToRoute, and that route
results in a payment error. The fix is simple: create the map even
though it won't be used in the sessions since the user is feeding the
router manual routes.
2018-07-08 16:34:25 -07:00
Olaoluwa Osuntokun
03650bbb18
Merge pull request #1470 from cfromknecht/multi-hop-itest-flake
lnd_test: remove itest race caused by mining extra block
2018-07-06 21:39:04 -05:00
Conner Fromknecht
daa28e0d0f
routing/chainview/bitcoind: improve filterMtx locking
In this commit, we modify the granularity of the locking
around the filterMtx in the bitcoind chainview, such that
we only lock once per block connected or filter update.
Currently, we acquire and release the lock for every
update to the map.

We also fix a bug that would cause us to not fully remove
all previous outpoints spent by a txn when doing manual
filter, as we previously would only remove the first output
detected.
2018-07-06 19:08:17 -07:00
Conner Fromknecht
0f6bc3538d
routing/chainview/btcd: improve filterMtx locking
In this commit, we modify the granularity of the locking
around the filterMtx in the btcd chainview, such that we
only lock once per block connected or filter update.
Currently, we acquire and release the lock for every
update to the map.

We also fix a bug that would cause us to not fully remove
all previous outpoints spent by a txn when doing manual
filter, as we previously would only remove the first output
detected.
2018-07-06 19:08:17 -07:00
Phil Opaola
6aaf692049 cmd: fix small typo in mnemonicCheck 2018-07-06 20:34:19 -05:00