Commit Graph

8869 Commits

Author SHA1 Message Date
carla
a2f029caca
lnrpc: add upfront shutdown address to open channel request 2019-12-17 23:18:25 +02:00
Joost Jager
e01600fdb8
sweep: add wallet inputs to reach dust limit
This commit allows sweeper to sweep inputs that on its own are not able
to form a sweep transaction that meets the dust limit.

This functionality is useful for sweeping small outputs. In the future,
this will be particularly important to sweep anchors. Anchors will
typically be spent with a relatively large fee to pay for the parent tx.
It will then be necessary to attach an additional wallet utxo.
2019-12-17 22:00:39 +01:00
Joost Jager
8353b6fd6e
sweep: extract sweepCluster method
Prepares for adding another level of nesting.
2019-12-17 22:00:37 +01:00
Joost Jager
34c9193bfc
sweep: create wallet interface
We need access to additional wallet functionality. This commit creates
an interface to prevent passing in multiple function pointers.
2019-12-17 22:00:35 +01:00
Joost Jager
b325aae4f2
sweep: extract positive input set struct
A refactoring that introduces no functional changes. This prepares for
the addition of wallet utxos to push the sweep tx above the dust limit.

It also enabled access to input-specific sweep parameters during tx
generation. This will be used in later commits to control the sweep
process.
2019-12-17 22:00:34 +01:00
Johan T. Halseth
fd4153851d
Merge pull request #3397 from carlaKC/peernotifier-addsubscribepeerrpc
lnrpc: Add subscribe peer events rpc
2019-12-17 21:46:24 +01:00
Johan T. Halseth
76dfd6326d
Merge pull request #3799 from carlaKC/chanfitness-bugfix
Bugfix: Chanfitness open time for offline peers
2019-12-17 20:54:34 +01:00
carla
3c28507062
lnrpc: Add subscribe peer events rpc 2019-12-17 21:26:55 +02:00
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
Joost Jager
2ce22d912b
Merge pull request #3763 from joostjager/close-later
cnct: keep open channel data after channel commitment tx confirms
2019-12-17 16:00:20 +01:00
Olaoluwa Osuntokun
c660e16229
README: update dev slack link 2019-12-17 11:39:00 -03:00
Johan T. Halseth
7044219f90
lnd test: fix csv mempool sweep time
Since CSV locked outputs specifies the first block where they are
allowed to be included, they can actually be added one block earlier
into the mempool.

This led to a flake, where the sweep tx was already in the mempool at
the time we mined the last block, causing the next mempool check to
fail.
2019-12-17 15:29:27 +01:00
Johan T. Halseth
b3b355659b
lncfg+lncli: replace WithDialer->WitchContextDialer
WithDialer is deprecated, use WitchContextDialer instead.
2019-12-17 13:37:29 +01:00
Johan T. Halseth
f0bd4e775b
Merge pull request #3775 from halseth/mobile-listener-signal
[mobile] make Ready signal for custom listeners
2019-12-17 12:26:04 +01: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
d85f378aa2
routing: move zero hops check 2019-12-16 14:53:47 +01:00
Joost Jager
31b2c22cf5
routing: check for invalid routes 2019-12-16 14:53:45 +01: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
Joost Jager
b8abae6a7e
routing: rename route variable to prevent clash with package 2019-12-14 08:47:53 +01: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
Joost Jager
071c57d4a4
sweep: embed input.Input interface
Get rid of needless referencing of the embedded object.
2019-12-13 12:02:44 +01:00
Joost Jager
38adfd7ecc
sweep: create sweep parameters struct
Prepares for adding more input-specific sweep parameters.
2019-12-13 12:02:42 +01:00
Joost Jager
e2bf6b49e9
sweep: fix bucket clustering
Fixes a bug where bucket sizes were not the configured size, but the
configured size plus the min relay fee.
2019-12-13 11:08:09 +01:00
Joost Jager
50078216ca
sweep: use bucket ids
Using a fee rate just as an identifier can be confusing.
2019-12-13 11:08:07 +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
Joost Jager
8c43232f66
chainregistry: set static min relay fee
We need it to be set in order to properly test the sweeper handling the
dust limit on regtest.
2019-12-12 14:05:43 +01:00