Commit Graph

9194 Commits

Author SHA1 Message Date
Valentine Wallace
cb26fd8a17 lnd: introduce the ChannelNotifier.
This commit introduces the channel notifier which is a central source
of active, inactive, and closed channel events.

This notifier was originally intended to be used by the `SubscribeChannels`
streaming RPC call, but can be used by any subsystem that needs to be
notified on a channel becoming active, inactive or closed.

It may also be extended in the future to support other types of notifications.
2019-02-05 18:17:54 -08:00
Valentine Wallace
b0b6151cc1 rpcserver: add helper functions to format open and closed RPC channels.
`createRPCChannel` is used by the `listchannels` RPC call and will be
used by `subscribechannels` as well.
`createRPCClosedChannel` is used by the `closedchannels` RPC call and
will also be used by `subscribechannels`.

This is used by the `listchannels` RPC call and will be used by
`subscribechannels` as well. Its purpose is to mitigate code duplication
between the two RPC calls.
2019-02-05 18:17:54 -08:00
Johan T. Halseth
5181f100ed subscribe: add new subscribe package
This commit creates a new package 'subscribe', that exposes a common
Client-Server subscription system, that can be shared among packages.
2019-02-05 18:17:54 -08:00
Conner Fromknecht
8ac5f2bb17
Merge pull request #2586 from halseth/neutrinonotify-return-on-rescan-error
chainnrnfs/neutrino: return on historicalConf error
2019-02-05 18:09:02 -08:00
Olaoluwa Osuntokun
e5d660daf9
Merge pull request #2521 from joostjager/sendtosingleroute
lnrpc: deprecate SendToRoute with more than one route
2019-02-05 18:06:01 -08:00
Conner Fromknecht
6c78fc5740
Merge pull request #2550 from halseth/autpilot-agent-quit-pending-conn
autopilot: don't block Stop on pending connection
2019-02-05 16:39:31 -08:00
Johan T. Halseth
49a85b2eb3
autopilot/agent_test: add TestAgentQuitWhenPendingConns
TestAgentQuitWhenPendingConns tests that we are able to stop the autopilot
agent even though there are pending connections to nodes.
2019-02-05 10:45:53 +01:00
Johan T. Halseth
c19763c03f
autopilot/agent: don't block Stop on pending connetion
To ensure a call to ConnectToPeer doesn't block the agent from
shutting down, we'll launch it in a non-waitgrouped goroutine, that
will signal when a result is returned.
2019-02-05 10:45:53 +01:00
Joost Jager
077e1887fa
Merge pull request #2564 from joostjager/move-paymentsession
routing: move payment session to separate file
2019-02-05 08:44:56 +01:00
Olaoluwa Osuntokun
27c7ce91f4
Merge pull request #2584 from halseth/utxonursery-baby-expiry-heighthint
utxonursery: use baby expiry as height hint
2019-02-04 17:21:28 -08:00
Olaoluwa Osuntokun
390018eae2
build+test+make: modify travis make directive to also compile sub-servers
In this commit, we modify the travis make directive to also compile all
the sub-severs using build flags. We do this as otherwise, we can only
detect mistakes in the build process of a sub-server via a manual
process. In this commit, we adapt travis to also cover this case.
2019-02-04 17:15:13 -08:00
Olaoluwa Osuntokun
a98d5deeb8
Merge pull request #2580 from halseth/autopilotrpc-imports-cleanup
[trivial] cleanup subserver imports
2019-02-04 12:46:53 -08:00
Johan T. Halseth
19ecc19d55
chainnrnfs/neutrino: return on historicalConf error
Would otherwise update height hint cache even on error during rescan.
2019-02-04 21:31:24 +01:00
Wilmer Paulino
e119b909e3
Merge pull request #2583 from Roasbeef/peer-info-conn-est
server: use chanInfo instead of chanPolicy to establish channel peer …
2019-02-04 12:16:44 -08:00
Joost Jager
17645fefdf
lnrpc: deprecate multiple routes sendtoroute 2019-02-04 13:07:30 +01:00
Joost Jager
5a4951affd
lnrpc: extract sendtoroute unmarshall to method 2019-02-04 13:06:58 +01:00
Johan T. Halseth
5d33d7226c
Merge pull request #2477 from cfromknecht/utxo-lnrpc
lnrpc: replace ChanPoint w/ OutPoint in ListUnspent resp
2019-02-04 12:50:57 +01:00
Johan T. Halseth
9d9d148262
utxonursery: use baby expiry as height hint
Previously we would use the best known height as height hint, which
could lead to using a height hint above the actual block it confirms,
hence losing track of the confirmation.
2019-02-04 12:30:05 +01:00
Johan T. Halseth
5d7bb7406f
Merge pull request #2568 from cfromknecht/lint-all-travis-builds
Makefile: lint all travis builds
2019-02-04 10:30:07 +01:00
Olaoluwa Osuntokun
1189f0ea6c
server: use chanInfo instead of chanPolicy to establish channel peer conns
In this commit, we modify the way we attempt to locate the our channel
peer to establish a persistent connection on start up. Before this
commit, we would use the channel policy pointing to the peer to locate
the node as it's embedded in the struct. However, at times it's
currently possible for the channel policy to not be found in the
database if the remote nodes announces before we finalize the process on
our end. This can at times lead to a panic as the pointer isn't checked
before attempting to access it.

To remedy this, we now instead use the channel info which will _always_
be there if the channel is known.
2019-02-03 15:01:37 -08:00
solid-pay
16cceb8932
Add a links to KDF and BIP39
Just text changes
2019-02-02 17:45:13 +01:00
Johan T. Halseth
3daaa8cf74
lndrpc/invoicesrpc+walletrpc: clean up imports 2019-02-02 15:48:22 +01:00
Johan T. Halseth
7dab8b8f2d
lnrpc/autopilotrpc: remove unused "os" import
This would cause the build to fail since the import is not used. It was
not detected since the file is under a build flag.
2019-02-02 15:48:15 +01:00
Olaoluwa Osuntokun
bcc9e30396
Merge pull request #2515 from cfromknecht/altruist-output-calc
watchtower/wtpolicy: altruist output calculation
2019-02-01 19:58:06 -08:00
Conner Fromknecht
4c632627ae
cmd/lncli/commands: filter txid_bytes from list_unspent 2019-02-01 18:02:02 -08:00
Conner Fromknecht
b25f1af347
cmd/lncli/types: add Utxo and OutPoint display types 2019-02-01 18:01:56 -08:00
Conner Fromknecht
c74dcbe6ff
lnrpc+rpcserver: replace ChanPoint w/ OutPoint in Utxo msg 2019-02-01 18:01:51 -08:00
Conner Fromknecht
ddfcba46e7
lnrpc/gen_protos: add missing space before escaped newline 2019-02-01 18:01:44 -08:00
Olaoluwa Osuntokun
8aecccf266
Merge pull request #2407 from joostjager/commit-resolver-sweeper
cnct: use sweeper in commit resolver
2019-02-01 17:34:51 -08:00
Conner Fromknecht
09e71a1d49
watchtower/multi: use ComputeJusticeTxOuts, test altruist+reward 2019-02-01 17:30:13 -08:00
Conner Fromknecht
9054a3ee4c
watchtower/wtpolicy/policy: add ComputeJusticeTxOuts 2019-02-01 17:26:48 -08:00
Olaoluwa Osuntokun
4af857f0c6
Merge pull request #2356 from joostjager/invoices-subserver
invoices: add subscribesingleinvoice
2019-02-01 17:19:58 -08:00
Conner Fromknecht
1703502505
watchtower/wtpolicy: add ComputeRewardOutputs 2019-02-01 17:19:33 -08:00
Conner Fromknecht
6b3691a86e
watchtower/wtpolicy: add ComputAltruistOutput calc 2019-02-01 17:19:27 -08:00
Olaoluwa Osuntokun
6032e47fe8
Merge pull request #1875 from joostjager/resolverstate
rpc+contractcourt: merge the contractResolver state into the pendingchannels RPC response
2019-02-01 17:07:53 -08:00
Olaoluwa Osuntokun
bceb048a76
Merge pull request #2385 from cfromknecht/peer-write-buffer
peer: write buffer pool
2019-02-01 17:04:30 -08:00
Olaoluwa Osuntokun
6a3addbeda
Merge pull request #2563 from halseth/funding-ensure-max-value-less-than-cap
funding: cap the max_htlc value at channel capacity
2019-02-01 16:29:33 -08:00
Wilmer Paulino
8d7879bab1
Merge pull request #2496 from halseth/itest-print-btc-amount
[trivial] lntest/node: print amounts in same format
2019-02-01 13:01:05 -08:00
Olaoluwa Osuntokun
66c80bb3c0
Merge pull request #2571 from Roasbeef/lnwire-onion-fix
lnwire: ensure we're able to decode legacy FailUnknownPaymentHash
2019-02-01 12:53:45 -08:00
Joost Jager
b16357116c
invoices: add SubscribeSingleInvoice test 2019-02-01 09:47:37 +01:00
Joost Jager
8996a1490d
lnrpc: reuse common FileExists function 2019-02-01 09:47:31 +01:00
Joost Jager
70c874be88
invoicesrpc: add SubscribeSingleInvoice rpc 2019-02-01 09:43:17 +01:00
Joost Jager
4c4536a488
lnrpc: move invoice marshall code to package
As a preparation for reusing the marshall code in the invoices sub
server.
2019-02-01 09:43:10 +01:00
Joost Jager
acb0162443
invoices: subscribe single invoice 2019-02-01 09:43:03 +01:00
Joost Jager
436dd41c77
channeldb: move idempotency up the call tree
As a preparation for subscribing to single invoices, InvoiceRegistry
needs to become aware of settling a settled invoice.
2019-02-01 09:42:56 +01:00
Joost Jager
2a4c93cdc4
lnrpc: add search path to gen_protos.sh
Without this addition, sub servers cannot import google annotations
in their proto files.
2019-02-01 09:42:48 +01:00
Joost Jager
78cd07570b
invoiceregistry: extract dispatch to method 2019-02-01 09:42:42 +01:00
Joost Jager
3545685177
invoicesrpc: create sub server
Sub server implementation is still empty. This is a preparatory
step for adding invoice functionality.
2019-02-01 09:42:35 +01:00
Joost Jager
bacd92418a
invoices: use lntypes.Hash and lntypes.Preimage
Previously chainhash.Hash was used, which converts to/from string in
reversed format. Payment hashes and preimages are supposed to be
non-reversed.
2019-02-01 09:42:29 +01:00
Joost Jager
18698663c5
lnhash: create Hash and Preimage types
This commit adds new hash and preimage types. These types are
similar to chainhash.Hash, except for that string representations
are not reversed.

The reason for adding dedicated types and not use [32]byte, is to
facilitate logging (%v displays as hex string) and have
standard methods to convert from byte slice and string with a
length check.
2019-02-01 09:42:23 +01:00