Commit Graph
8595 Commits
Author SHA1 Message Date
carla eebc23a8ad chanfitness: set open time for channels with offline peers
This commit addresses a bug in the channel event store
where the opened time of a channel event log was not
set for peers that were offline on startup.

Previously, opened time was set to the time of the first
event in the event log. This worked for online peers,
because the eventlog was created with an initial online
event. However, offline peers had no inital event so had
no open time set.

This commit simplifies the creation of an event log by
removing the initial event and setting open time for all
event logs. This has the effect of potentially introducing
a gap between opened time for a log and the first peer
online event for peers with channels that exist at startup
if a peer takes time to reconnect. However, the cost of this
is less than the benefit of reducing the bug-prone custom
code path that was previously in place.
2019-12-17 17:36:28 +02:00
carla 4f9795e8ae chanfitness: switch to query by channel outpoint
In this commit, the channelEventStore in the channel
fitness subsystem is changed to identify channels
by their outpoint rather than short channel id. This
change is made made becuase outpoints are the preferred
way to expose references over rpc, and easier to perform
queries within lnd.
2019-12-17 17:36:28 +02:00
carla 47e700ba9e rpcserver: return uptime errors for known channels
Upgrade logging of channel uptime/lifespan query errors
to returning the error, with the exception of the case
where the channel is known to the store. This error is
logged, due to the potential for race conditions between
the channel event store being notified of a new open
channel and the rpc channel subscription creating a rpc
channel struct (which queries for uptime).
2019-12-17 17:36:27 +02:00
carla ec12463a95 chanfitness: define and export ErrChannelNotFound 2019-12-17 17:36:21 +02:00
Conner Fromknecht 46a994350c Merge pull request #3834 from cfromknecht/transitive-features
feature: add transitive feature bit validation
2019-12-16 14:00:58 -08:00
Conner Fromknecht 34fd27280a peer: validate remote peer's feature deps 2019-12-16 13:06:59 -08:00
Conner Fromknecht 3208e287c3 feature/manager: ensure all feature sets properly set deps 2019-12-16 13:06:45 -08:00
Conner Fromknecht 868a5425c1 feature/deps: validate feature dependencies 2019-12-16 13:06:30 -08:00
Conner Fromknecht 24e663519a lnwire/features: add payment-addr and mpp feature bits 2019-12-16 13:06:15 -08:00
Joost Jager 77fde0f201 Merge pull request #3840 from joostjager/queryroutes-padding-comment
lnrpc: clarify block padding requirement for QueryRoutes
2019-12-16 15:48:08 +01:00
Olaoluwa Osuntokun 2c92b75df9 Merge pull request #3837 from cfromknecht/node-features-rpc
lnrpc: display node and peer features via rpc
2019-12-16 06:13:55 -08:00
Joost Jager 9ae02796fa lnrpc: clarify block padding requirement for QueryRoutes 2019-12-16 13:38:01 +01:00
Conner Fromknecht b2d276feb8 lnrpc: update all feature vectors to maps 2019-12-14 07:05:21 -08:00
Conner Fromknecht 990bdd6b64 lnrpc: display remote peer features via rpc 2019-12-14 07:05:07 -08:00
Conner Fromknecht db0029d03d lnrpc: add node features to LightningNode and NodeInfo 2019-12-14 07:04:51 -08:00
Olaoluwa Osuntokun eae45f9ad9 zpay32: use new DefaultInvoiceExpiry constant 2019-12-13 19:54:37 -08:00
Olaoluwa Osuntokun e34bc3d645 Merge pull request #3694 from bhandras/i3448
invoices+channeldb: reject payments to expired invoices
2019-12-13 19:53:53 -08:00
Wilmer Paulino 1fb28b6cd9 Merge pull request #3745 from akovalenko/master
lncli addholdinvoice: allow specifying msat with --amt_msat
2019-12-13 10:45:16 -08:00
Andras Banki-Horvath 0758b9310e channeldb: adding a unit test for FetchAllInvoicesWithPaymentHash
This commit changes how FetchAllInvoicesWithPaymentHash behaves
when the DB is empty and also adds a unit test to test that
case as well as normal expected behavior.
2019-12-13 17:03:19 +01:00
Andras Banki-Horvath 44f13d1d60 invoices: adding InvoiceExpryWatcher to cancel expired invoices
This commit adds InvoiceExpryWatcher which is a separate class that
receives new invoices (and existing ones upon restart) from InvoiceRegistry
and actively watches their expiry. When an invoice is expired
InvoiceExpiryWatcher will call into InvoiceRegistry to cancel the
invoice and by that notify all subscribers about the state change.
2019-12-13 17:03:08 +01:00
Andras Banki-Horvath 7024f36a76 general: adding the Clock interface to aid testing
This commit adds Clock and DefaultClock and moves the private
invoices.testClock under the clock package while adding basic
unit tests for it.
Clock is an interface currently encapsulating Now() and TickAfter().
It can be added as an external dependency to any class. This way
tests can stub out time.Now() or time.After().

The DefaultClock class simply returns the real time.Now() and
time.After().
2019-12-13 16:52:22 +01:00
Andras Banki-Horvath ff3063daea queue: fixing doc after cherry pick
This commit just fixes a godoc and adds a new one to the already
merged queue.PriorityQueue.
2019-12-13 16:52:22 +01:00
Andras Banki-Horvath 88e01fa1fa invoices: refactor test helpers
This commit moves test helpers to their on file, while also adding helper to
create an invoice with a valid payment request.
2019-12-13 16:52:18 +01:00
Johan T. Halseth 27430f8bc9 Merge pull request #3832 from cfromknecht/fix-signer-protos
signrpc: fix uncommitted changes from proto
2019-12-13 10:02:17 +01:00
Conner Fromknecht d5d38c6e01 signrpc: fix uncommitted changes from proto 2019-12-12 17:20:33 -08:00
Conner Fromknecht 1901f59c07 Merge pull request #3828 from joostjager/custom-records-sanity
channeldb: custom records sanity check
2019-12-12 11:36:27 -08:00
Joost Jager de2b7b78de channeldb: custom records sanity check 2019-12-12 17:49:36 +01:00
Joost Jager d16476e477 routerrpc+record: move custom set validation 2019-12-12 17:49:34 +01:00
Joost Jager 75b94dec2b Merge pull request #3819 from joostjager/fix-custom-record-payment
multi: fix custom record payment
2019-12-12 14:33:05 +01:00
Conner Fromknecht cc18d0ae6b Merge pull request #3824 from cfromknecht/invoice-features-rpc
lnrpc: expose features on rpc invoices
2019-12-12 01:33:48 -08:00
Johan T. Halseth c04ef68cc3 Merge pull request #3826 from arik-so/wrong_chain_error_fix
fix order in wrong chain error message
2019-12-12 09:46:31 +01:00
Conner Fromknecht aba49c9a5a rpcserver: populate features on lnrpc invoices
In the process, we also move the feature serialization into the
invoicesrpc package, so that it can be shared between the invoicesrpc
and main rpcserver.
2019-12-12 00:12:51 -08:00
Conner Fromknecht 7446495b6d lnrpc: add features field to invoices 2019-12-12 00:08:18 -08:00
Olaoluwa Osuntokun dca31c2bf8 Merge pull request #3825 from cfromknecht/ensure-fv-populated
zpay32: ensure feature vector is always populated
2019-12-11 21:43:48 -08:00
Olaoluwa Osuntokun a5519d1af1 build: update go.mod to use queue/v1.0.2 2019-12-11 19:06:48 -08:00
Olaoluwa Osuntokun 338175534e Merge pull request #3812 from guggero/sign-custom
signrpc: sign and verify messages with custom key
2019-12-11 18:51:55 -08:00
Arik Sosman e83df875ad fix wrong chain error message 2019-12-11 17:43:24 -08:00
Conner Fromknecht 840476996c zpay32: ensure feature vector is always populated 2019-12-11 17:37:18 -08:00
Joost Jager 75aa4e7061 routing: require tlv capability for custom record payments
Previously if a payment was sent with custom records attached, path
finding wouldn't perform a check whether the final node was capable of
receiving custom records in a tlv payload.
2019-12-12 00:15:02 +01:00
Joost Jager c37289cd94 routing: pass custom records into pathfinding 2019-12-12 00:15:00 +01:00
Joost Jager d02de70d20 multi: do not use tlv.Record outside wire format handling
This commit prepares for more manipulation of custom records. A list of
tlv.Record types is more difficult to use than the more basic
map[uint64][]byte.

Furthermore fields and variables are renamed to make them more
consistent.
2019-12-12 00:14:58 +01:00
Joost Jager 8b5bb0ac63 record: move CustomRecordSet 2019-12-12 00:12:19 +01:00
Joost Jager 7aa4a7c7fc channeldb/migration_01_to_11: isolate route structure
Before we change the Hop struct, isolate the code that is used in older
migrations to prevent breaking them.

route.go was taken from commit 6e463c1634
2019-12-12 00:12:17 +01:00
Oliver Gugger 95226771ed signrpc+rpcserver: add signer macaroon permissions 2019-12-11 22:37:40 +01:00
Oliver Gugger 9a73b9be78 signrpc: sign and verify messages with custom key
To allow signing of messages with any key in the key chain
we add two new methods to the signer RPC. These behave differently
to the methods with the same name in the main RPC as described
in the documentation comment.
2019-12-11 22:37:39 +01:00
Joost Jager 62dadff291 Merge pull request #3415 from joostjager/mpp
htlcswitch+invoices: allow settling invoices via multi-path payments
2019-12-11 19:30:15 +01:00
Joost Jager 907f0f1948 Merge pull request #3820 from joostjager/fix-logger
build: prevent loggers from overwriting each other.
2019-12-11 17:33:42 +01:00
Joost Jager b2f43858c3 invoices: accept mpp payments 2019-12-11 16:14:49 +01:00
Joost Jager 56958493fe invoices/test: add test clock 2019-12-11 16:08:09 +01:00
Joost Jager 499f2b16cf invoices: add RegistryConfig struct 2019-12-11 16:08:07 +01:00