Commit Graph

11259 Commits

Author SHA1 Message Date
Wilmer Paulino
6394c2fbb5
lnrpc: add route hints proto field to invoices 2018-04-20 04:01:35 -04:00
Wilmer Paulino
ea9e609ef0
zpay32: modify an invoice's r field to allow multiple routes
Before this commit, if an invoice encoded multiple `r` fields, we would
decode them as one single route. We fix this by allowing an invoice to
store multiple routes.
2018-04-20 04:01:34 -04:00
Wilmer Paulino
beb08b3887
routing: add test for finding paths with additional edges 2018-04-20 04:01:33 -04:00
Wilmer Paulino
4598df054e
routing: modify findPath to take into account additional edges
In this commit, we modify our path finding algorithm to take an
additional set of edges that are currently not known to us that are
used to temporarily extend our graph with during a payment session.
These edges should assist the sender of a payment in successfully
constructing a path to the destination.

These edges should usually represent private channels, as they are not
publicly advertised to the network for routing.
2018-04-20 04:01:32 -04:00
Wilmer Paulino
7965247db1
routing: add additionalEdges field to a missionControl's paymentSession
In this commit, we introduce the ability for payment sessions to store
an additional set of edges that can be used to assist a payment in
successfully reaching its destination.
2018-04-20 04:01:31 -04:00
Wilmer Paulino
5ddee85479
routing: prevent logging the public key params within the routing hints 2018-04-20 04:01:30 -04:00
Wilmer Paulino
1e5659e5f4
routing: introduce routing hints to lightning payments
In this commit, we add a new field of routing hints to payments over the
Lightning Network. These routing hints can later be used within the path
finding algorithm in order to craft a path that will reach the
destination succesfully.
2018-04-20 04:01:29 -04:00
Jimmy Song
c8abeb46a5 docs: add symlink for go suggestion to INSTALL.md 2018-04-19 16:06:39 -07:00
Olaoluwa Osuntokun
e2229b74e7
Merge pull request #1081 from t4sk/queryroutes-return-msat
Include millisatoshis in queryroutes
2018-04-18 19:33:43 -07:00
Olaoluwa Osuntokun
431f3f3185
build: update to latest btcwallet commit
In this commit we update to the latest version of btcwallet which will
properly detect bitcoind rejections when attempting to retransmit
unmnined transaction on restart. Additionally, we'll now remove any
transaction that are rejected from the mempool at broadcast time.

Related to #1030.
2018-04-18 19:01:25 -07:00
t4sk
eb80d07b26 tests: add integration tests for queryroutes 2018-04-19 09:15:21 +08:00
t4sk
49510d775f rpcserver: include millisatoshis in marshallRoute 2018-04-19 09:15:21 +08:00
t4sk
31feeca51a lnrpc: extend Route to include millisatoshis 2018-04-19 09:15:21 +08:00
Sean Erle Johnson
eab87140e9 lncli: make locating funding_txids easier 2018-04-18 12:38:25 -07:00
Sean Erle Johnson
c6499f095a zpay32: improve "wrong network" error message 2018-04-18 12:37:28 -07:00
Sean Erle Johnson
938d367232 server: change PeerNotFound to PeerNotConnected 2018-04-18 12:34:57 -07:00
Olaoluwa Osuntokun
005510b54f
chainntnfs/bitcoindnotify: fix possible panic with lack of txindex
In this commit, we fix a recently introduced bug which can result in a
panic when bitcoind nodes without a txindex active are started. The
issue was that we would still defence the transaction's blockhash, which
would be nil if we detected that the backend didn't have the txindex
active.
2018-04-17 20:08:58 -07:00
Olaoluwa Osuntokun
188b8462cd
lnwallet: update addr in transactions_test.go for new regtest hrp 2018-04-17 19:26:32 -07:00
Olaoluwa Osuntokun
d63b923f5e
Revert "rpcserver: remove uneccessary signal to breacharbiter at force close"
This reverts commit 0f90c950daaec7843e305f32d10e36411fb0b47f.

We actually still need to notify the BRAR of a force close, as
otherwise, it doesn't have a signal to exit due to a local force close
event.
2018-04-17 19:05:40 -07:00
Dimitris Tsapakidis
4009f7f874 multi: fix typos in comments 2018-04-17 19:03:27 -07:00
practicalswift
663c396235 multi: fix a-vs-an typos 2018-04-17 19:02:04 -07:00
yohei okada
0720e83840 main: Stop setting GOMAXPROCS to NumCPU explicitly (#1096)
GOMAXPROCS will be set automatically after Go 1.5. The minimum version
supported at the moment is 1.9, so setting GOMAXPROCS to NumCPU is not
necessary anymore.

References
https://docs.google.com/document/d/1At2Ls5_fhJQ59kDK2DFVhFu3g5mATSXqqV5QrxinasI/edit
https://tip.golang.org/doc/go1.5#introduction
2018-04-17 18:59:23 -07:00
yohei okada
7a50097dec docs: update Go version to 1.9 in Contribution Checklist (#1095)
According to install.md, the minimum version of Go supported at the 
moment is 1.9, so update the Go version referenced in Contribution 
Checklist to 1.9 as well.
2018-04-17 18:58:46 -07:00
Danny Paz
3c73329912 docs/grpc/javascript: updated docs to include macaroon and cipher suites 2018-04-17 18:42:55 -07:00
Olaoluwa Osuntokun
21b6c62bf9
Merge pull request #1020 from mecampbellsoup/add-version-to-getnetworkinfo-rpc
Add version field to GetInfo RPC endpoint
2018-04-17 18:41:18 -07:00
Olaoluwa Osuntokun
f6e6196f65
Merge pull request #898 from vapopov/hrprefix
Wrong BOLT11 prefix in regtest
2018-04-17 18:30:37 -07:00
Olaoluwa Osuntokun
8649181e95
build: update to latest version of btcd with proper regtest hrp 2018-04-17 18:28:25 -07:00
Olaoluwa Osuntokun
1f4a02e814
Merge pull request #751 from wpaulino/txindex
Remove txindex requirement for full nodes
2018-04-17 18:20:10 -07:00
Wilmer Paulino
ead9555d40
chainregistry: remove txindex requirement for btcd and bitcoind
Now that we have a fallback method for when the transaction index is not
enabled, its requirement to be enabled for a full node is no longer
needed, so we can safely remove this check.
2018-04-17 14:59:52 -04:00
Wilmer Paulino
13fb866574
chainntnfs: remove txindex requirement when registering notfications
Before this commit, we relied on the need of full nodes to enable the
transaction index. This allowed us to fetch historical details about
transactions in order to register and dispatch confirmation and spend
notifications.

This commit allows us to drop that requirement by providing a fallback
method to use when the transaction index is not enabled. This fallback
method relies on manually scanning blocks for the transactions
requested, starting from the earliest height the transactions could have
been included in, to the current height in the chain.
2018-04-17 14:59:51 -04:00
Olaoluwa Osuntokun
7f039980c1
lnd+cmd/lncli: allow users to disable logging sub-systems all together 2018-04-16 19:18:04 -07:00
Olaoluwa Osuntokun
09291d6aeb
contractcourt: ensure the closeObserver exits on quit 2018-04-16 17:28:48 -07:00
Olaoluwa Osuntokun
f23848cac0
Merge pull request #1093 from halseth/copy-htlc-rhash
[bugfix] Copy htlc rhash when returing ListChannelsResponse
2018-04-16 17:18:56 -07:00
Olaoluwa Osuntokun
87c1ca1a84
Merge pull request #1105 from halseth/chainntfs-btcd-hostorical-mempool-spends
Notify on confirmed spends during btcd rescans
2018-04-16 16:38:46 -07:00
Johan T. Halseth
53ec1c6fd2
chainntnfs test: Test historical dispatch for mempool and non-mempool clients
This commit extends the test to exercise a scanario that wasn't properly
covered, by registering for a confirmed spend notification for a
historical spend. We also extend the test to make sure it handles buried
spends properly.
2018-04-16 20:09:17 +02:00
Johan T. Halseth
5d6dd90d18
chainntnfs/btcdnotify: correctly notify on confirmed rescan spends
This commit fixes a recently introduced bug in the btcdnotifier, where
we would skip all spend clients waiting for a confirmed spend in
txUpdates. The regular case where a spend is included in a new block was
correctly handled in onBlockConnected, but the txUpdates queue is also
used for confirmed spends during rescans, which we would miss. This
commit fixes that by checking if the tx update is confirmed or
unconfirmed, and acts accordingly.
2018-04-16 20:09:08 +02:00
Johan T. Halseth
6573eed37b
lnd_test: wrap check for expected number of channels in WaitPredicate 2018-04-15 18:55:55 +02:00
Johan T. Halseth
4bd45b22eb
lnd_test: make assertActiveHtlcs correctly check the exact pay hashes 2018-04-15 11:36:20 +02:00
Johan T. Halseth
daeeca0bc3
rpcserver: make copy of htlc rhash before returning in listchannels
This commit fixes a bug where all the HTLC rhash slices in a
ListChannelsResponse would be tied to the loop variable, making them all
take the hash of the last HTLC in the list. This commit fixes it by
making a copy of the slice.
2018-04-15 11:36:20 +02:00
Olaoluwa Osuntokun
b0709b45f7
Merge pull request #1090 from halseth/servertest-build-flag
[trivial] server test: add !rpctest build flag
2018-04-13 20:43:49 -07:00
Olaoluwa Osuntokun
4bf86aab27
test: in testUpdateChannelPolicy wait for Alice to learn of all channels
In this commit, we fix an existing flake in the integration tests. If it
was the case that Alice didn't yet know of all the channels, then the
payment attempt below would fail at times, depending on other timing
factors in the test. We fix this flake by waiting for Alice to learn of
all channels before we proceed to the actual testing logic.
2018-04-13 15:35:59 -07:00
Olaoluwa Osuntokun
5f0d07e485
Merge pull request #1089 from halseth/resolvecontract-missing-return-on-exit
Add missing return on exit to resolveContract
2018-04-13 14:23:13 -07:00
Olaoluwa Osuntokun
cc08baec63
Merge pull request #1088 from Roasbeef/chan-close-fix
contractcourt: fix co-op chan close issue by not closing over loop iterator variable
2018-04-13 13:41:41 -07:00
Johan T. Halseth
e949b6a915
server test: add !rpctest build flag 2018-04-13 12:27:01 +02:00
Johan T. Halseth
44f0ec9263
lnd_test: increase timeout for mempool tx 2018-04-13 12:07:58 +02:00
Johan T. Halseth
c5169a79f5
contractcourt/channel_arbitrator: add missing return on resolver exit
This commit adds a missing return to the resolveContract method, that
will ensure the goroutine exits if the ChannelArbitrator shuts down.
This fixes a potential deadlock during the integration tests.

We also promote some of the logs to Debug from Trace.
2018-04-13 11:33:09 +02:00
Johan T. Halseth
25d56eda6f
lntest: timeout if process not exited in 1 minute 2018-04-13 11:33:08 +02:00
Olaoluwa Osuntokun
86ad6d318e
Merge pull request #889 from wpaulino/chainnotifier-updates
chainntnfs: add incremental update notifications within ChainNotifier
2018-04-12 19:21:26 -07:00
Olaoluwa Osuntokun
aaa8fa33b1
contractcourt: when creating resolveContract closure don't bind to loop variable
In this commit, we fix a long standing bug where at times a co-op
channel closure wouldn't be properly marked as fully closed in the
database. The culprit was a re-occurring code flaw we've seen many times
in the codebase: a closure variable that closes over a loop iterator
variable. Before this instance, I assumed that this could only pop up
when goroutines bind to the loop iterator within a  closure. However,
this instance is the exact same issue, but within a regular closure that
has _delayed_ execution. As the closure doesn't execute until long after
the loop has finished executing, it may still be holding onto the _last_
item the loop iterator variable was assigned to.

The fix for this issue is very simple: re-assign the channel point
before creating the closure. Without this fix, we would go to call
db.MarkChanFullyClosed on a channel that may not have yet actually be in
the pending close state, causing all executions to fail.

Fixes #1054.
Fixes #1056.
Fixes #1075.
2018-04-12 18:54:33 -07:00
Olaoluwa Osuntokun
f052f18312
test: extend closeChannelAndAssert to also check that channel is no longer pending close
In this commit, we extend the closeChannelAndAssert testing utility
function to ensure that the channel is no longer marked as "pending
close" in the database. With this change, we hop to catch a recently
reported issue wherein users report that a co-op close channel has been
fully confirmed, yet it still pops up in the `pendingchannels` command.
2018-04-12 18:54:32 -07:00