Commit Graph

8581 Commits

Author SHA1 Message Date
db0029d03d lnrpc: add node features to LightningNode and NodeInfo 2019-12-14 07:04:51 -08:00
eae45f9ad9 zpay32: use new DefaultInvoiceExpiry constant 2019-12-13 19:54:37 -08:00
e34bc3d645 Merge pull request #3694 from bhandras/i3448
invoices+channeldb: reject payments to expired invoices
2019-12-13 19:53:53 -08:00
1fb28b6cd9 Merge pull request #3745 from akovalenko/master
lncli addholdinvoice: allow specifying msat with --amt_msat
2019-12-13 10:45:16 -08:00
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
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
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
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
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
27430f8bc9 Merge pull request #3832 from cfromknecht/fix-signer-protos
signrpc: fix uncommitted changes from proto
2019-12-13 10:02:17 +01:00
d5d38c6e01 signrpc: fix uncommitted changes from proto 2019-12-12 17:20:33 -08:00
1901f59c07 Merge pull request #3828 from joostjager/custom-records-sanity
channeldb: custom records sanity check
2019-12-12 11:36:27 -08:00
de2b7b78de channeldb: custom records sanity check 2019-12-12 17:49:36 +01:00
d16476e477 routerrpc+record: move custom set validation 2019-12-12 17:49:34 +01:00
75b94dec2b Merge pull request #3819 from joostjager/fix-custom-record-payment
multi: fix custom record payment
2019-12-12 14:33:05 +01:00
cc18d0ae6b Merge pull request #3824 from cfromknecht/invoice-features-rpc
lnrpc: expose features on rpc invoices
2019-12-12 01:33:48 -08:00
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
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
7446495b6d lnrpc: add features field to invoices 2019-12-12 00:08:18 -08:00
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
a5519d1af1 build: update go.mod to use queue/v1.0.2 2019-12-11 19:06:48 -08:00
338175534e Merge pull request #3812 from guggero/sign-custom
signrpc: sign and verify messages with custom key
queue/v1.0.2
2019-12-11 18:51:55 -08:00
e83df875ad fix wrong chain error message 2019-12-11 17:43:24 -08:00
840476996c zpay32: ensure feature vector is always populated 2019-12-11 17:37:18 -08:00
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
c37289cd94 routing: pass custom records into pathfinding 2019-12-12 00:15:00 +01:00
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
8b5bb0ac63 record: move CustomRecordSet 2019-12-12 00:12:19 +01:00
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
95226771ed signrpc+rpcserver: add signer macaroon permissions 2019-12-11 22:37:40 +01:00
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
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
907f0f1948 Merge pull request #3820 from joostjager/fix-logger
build: prevent loggers from overwriting each other.
2019-12-11 17:33:42 +01:00
b2f43858c3 invoices: accept mpp payments 2019-12-11 16:14:49 +01:00
56958493fe invoices/test: add test clock 2019-12-11 16:08:09 +01:00
499f2b16cf invoices: add RegistryConfig struct 2019-12-11 16:08:07 +01:00
56282db30a queue: Introducing a general purpose priority queue.
This commit introduces PriorityQueue, which is a general, heap
based priority queue, and PriorityQueueItem which is an interface
that concrete priority queue items must implement.
This implementation is encapsulated, users do not need to use any
other package for full functionality.
PriorityQueue exports the usual public methids: Push, Pop, Top,
Empty and Len. For full documentaton consult the priority_queue.go,
for usage: priority_queue_test.go
2019-12-11 16:08:05 +01:00
9f1720dea8 build: prevent loggers from overwriting each other.
Previously only the last registered logger would receive debug level
changes.
2019-12-11 15:22:00 +01:00
70c5fe3d00 Merge pull request #3697 from joostjager/lower-min-htlc
config: improve management of htlc amount lower limit
2019-12-10 18:05:49 -08:00
a7c2b12f5c Merge pull request #3785 from Roasbeef/gossip-queries-fix
discovery: properly set FirstBlockHeight and NumBlocks in responses
2019-12-10 18:03:50 -08:00
6a9b96122d discovery: properly set FirstBlockHeight and NumBlocks in responses
In this commit we fix in a bug in `lnd` that could cause other
implementations which implement a strict version of the spec to
disconnect when trying to sync their channel graph using the gossip
query feature. Before this commit, we would embed the request to a
`QueryChannelRange` in the response, causing some clients to reject the
response as the `FirstBlockHeight` and `NumBlocks` field would be
identical for each chunk of the response.

In order to remedy this, we now properly set these two fields with each
returned chunk. Note that even after this commit, we keep our existing
behavior surrounding the `Complete` field as is. Otherwise, current
`lnd` clients which rely on this field (rather than the two
aforementioned fields) wouldn't be able to properly detect when a set of
responses to their query was "complete".

Partially fixes #3728.
2019-12-10 17:05:58 -08:00
61e114f201 autopilot: take channel min htlc from config 2019-12-11 00:17:10 +01:00
b6eb3a69ba routing+lnrpc+lncli: allow setting min htlc policy 2019-12-11 00:17:08 +01:00
74c2df658e localchans: log policy update error 2019-12-11 00:17:06 +01:00
f289dbd826 routing: define subsystem constant 2019-12-11 00:17:04 +01:00
16ca36985e chainregistry: lower incoming htlc amount default 2019-12-11 00:17:02 +01:00
b826858a50 config: expose minhtlcout as a config parameter 2019-12-11 00:17:01 +01:00
55ff1131de fundingmanager: check remote min htlc against our defaults 2019-12-11 00:16:59 +01:00
ddb98fcc41 multi: distinguish between htlc in and out constraints 2019-12-11 00:16:57 +01:00
d8fd6fae23 config+channeldb: describe min_htlc fields more accurately 2019-12-11 00:16:55 +01:00