Commit Graph

9161 Commits

Author SHA1 Message Date
Olaoluwa Osuntokun
421d73b72e channeldb: add new frozen channel type bit and thaw height
In this commit, we add a new channel type bit: a frozen channel. A
frozen channel is one that can only be cooperatively closed by the
responder, but not the initiator. This channel type is useful for
certain classes of channel factory like protocols. We then add a new key
on the channel bucket level to store the height after which this
restriction no longer applies.
2020-03-23 16:56:48 -07:00
Conner Fromknecht
8fd5d13c75 Merge pull request #4064 from breez/optimistic-batch-limit
Use batch for historical confirmations filters request.
2020-03-23 13:59:10 -07:00
Conner Fromknecht
4e793497c8 Merge pull request #2669 from cfromknecht/use-netann-in-discovery
netann+discovery+server: consolidate network announcements to netann pkg
2020-03-23 13:38:06 -07:00
Roei Erez
ceb454aa16 neutrinonotify: use batch for historical confirmations.
This commit introduces an optimization for the chain scanning
used in historical confirmations notifications.
It now uses batch request instead of requesting filters one by one.
2020-03-23 09:51:13 +02:00
Carla Kirk-Cohen
c3ffdb7af4 Merge pull request #4095 from carlaKC/4036-surfacepushamounts
lnrpc: Add push amount to listchannels
2020-03-23 08:44:53 +02:00
Johan T. Halseth
42638183d8 Merge pull request #4105 from carlaKC/lnrpc-formatroutingprotos
routerrpc: run rpc-format on routerrpc
2020-03-20 20:57:42 +01:00
carla
5516a53728 routerrpc: run rpc-format on routerrpc 2020-03-20 11:11:45 +02:00
Olaoluwa Osuntokun
5cf3c08d95 Merge pull request #4104 from chokoboko/config-defaults-fix
[trivial] config: remove default values from flag descriptions
2020-03-19 20:15:03 -07:00
chokoboko
090d56b3a2 config: remove default values from flag descriptions 2020-03-20 01:07:47 +02:00
Conner Fromknecht
92456d063d discovery: remove unused updateChanPolicies struct 2020-03-19 13:43:57 -07:00
Conner Fromknecht
5c2fc4a2d6 discovery/gossiper: use netann pkg for signing channel updates 2020-03-19 13:43:39 -07:00
Johan T. Halseth
c1d00a0c9b Merge pull request #4101 from ErikEk/typo_fixes_trivial
trivial: typo fixes
2020-03-19 21:36:38 +01:00
carla
72e3b0a5d7 lnrpc: add push amount to listchannels 2020-03-19 13:20:26 +02:00
carla
41355756a1 channeldb: add balance at height lookup
Add a balance at height lookup function which can be used to
obtain local/remote balance at a given height. The current in memory
commits and revocation log are used to source this information.
2020-03-19 13:20:17 +02:00
Roei Erez
3d71a28cce build: update dependencies 2020-03-19 12:00:36 +02:00
ErikEk
4e47181b99 trivial: typo fix 2020-03-19 05:43:49 +01:00
Olaoluwa Osuntokun
4897b34050 Merge pull request #3833 from Roasbeef/kv-abstraction
channeldb/kvdb: introduce new KV-store database abstraction
2020-03-18 20:20:07 -07:00
Olaoluwa Osuntokun
a4e39906b1 build: silence new linter errors, tidy modules
The explicit `bbolt` dep is gone, as we depend on `kvdb`, which is
actually `walletdb`, which has its own module that defines the proper
`bbolt` version.
2020-03-18 19:35:29 -07:00
Olaoluwa Osuntokun
071c7cbe78 lnd: convert to use new kvdb abstraction 2020-03-18 19:35:23 -07:00
Olaoluwa Osuntokun
21521ff610 autopilot: convert to use new kvdb abstraction 2020-03-18 19:35:20 -07:00
Olaoluwa Osuntokun
f1963084a8 chainntnfs: convert to use new kvdb abstraction 2020-03-18 19:35:16 -07:00
Olaoluwa Osuntokun
98170e00ef lnwallet: convert to use new kvdb abstraction 2020-03-18 19:35:13 -07:00
Olaoluwa Osuntokun
46cec2fdc0 sweep: convert to use new kvdb abstraction 2020-03-18 19:35:10 -07:00
Olaoluwa Osuntokun
ace7a78494 discovery: covert to use new kvdb abstraction 2020-03-18 19:35:07 -07:00
Olaoluwa Osuntokun
852b2380a9 macaroons: convert to use new kvdb abstraction 2020-03-18 19:35:04 -07:00
Olaoluwa Osuntokun
557b930c5f watchtower: convert to use new kvdb abstraction 2020-03-18 19:35:01 -07:00
Olaoluwa Osuntokun
28bbaa2a94 routing: convert to use new kvdb abstraction 2020-03-18 19:34:58 -07:00
Olaoluwa Osuntokun
4e68914e9d htlcswitch: convert to use new kvdb abstraction 2020-03-18 19:34:55 -07:00
Olaoluwa Osuntokun
320101d054 contractcourt: convert to use new kvdb abstraction 2020-03-18 19:34:52 -07:00
Olaoluwa Osuntokun
f0911765af channeldb: convert to uniformly use new kvdb abstractions
In this commit, we migrate all the code in `channeldb` to only reference
the new `kvdb` package rather than `bbolt` directly.

In many instances, we need to add two version to fetch a bucket as both
read and write when needed. As an example, we add a new
`fetchChanBucketRw` function. This function is identical to
`fetchChanBucket`, but it will be used to fetch the main channel bucket
for all _write_ transactions. We need a new method as you can pass a
write transaction where a read is accepted, but not the other way around
due to the stronger typing of the new `kvdb` package.
2020-03-18 19:34:49 -07:00
Olaoluwa Osuntokun
fc808ac538 channeldb/kvdb: create new package for an abstract kv store
In this commit, we create a new package `kvdb`, which is meant to serve
as the basis for any future database abstractions within `lnd`. Rather
than directly use the `walletdb` package (which we base off of), we
instead use a series of type-aliases to re-type the fundamental
types/interfaces of the `walletdb` package. This lets us type
`kvdb.RwTx` instead of `walletdb.ReadWriteTransaction` everywhere.
Additionally, our usage of type-aliases is also intended to create an
easy pathway in the future wherein we can gradually re-defined or
re-implement these types to wean off of the `walletdb` package.
2020-03-18 19:34:45 -07:00
Joost Jager
e2052f7f65 Merge pull request #3758 from joostjager/anchor-output-poc-joost
cnct: anchor output sweeping and fee bumping
2020-03-18 18:59:06 +01:00
Joost Jager
fa115b543d lncli: add bumpchannelclose command
This command allows users to easily bump the fee on their unconfirmed
closing transactions.
2020-03-18 12:27:06 +01:00
Joost Jager
d60303b092 lnrpc: expose commit hashes for waiting close channels
To make it easier to determine which pending sweep to bump in order to
get your anchor commitment tx confirmed.
2020-03-18 12:27:05 +01:00
Joost Jager
ab451f634e cnct+lnrpc: report anchor resolution 2020-03-18 12:27:03 +01:00
Joost Jager
ea397c9d6e cnct: resolve anchors post-confirmation
Sweeping anchors and being able to bump the fee was already added in a
previous commit. This commit extends anchor sweeping with an anchor
resolver object that becomes active after the commitment tx confirms.
At that point, the anchors do not serve the purpose of getting the
commitment tranaction confirmed anymore. It is however still possible to
reclaim some of their value if using a low fee rate.
2020-03-18 12:27:01 +01:00
Joost Jager
d84b596f55 cnct: do not ignore resolver reports after resolution
Preparation for anchor resolver. The recovered anchor amount should
still be included in the pending channel report even after it has been
resolved.

This also fixes an existing bug that in some cases caused the recovered
amount from an htlc resolver not to be included in the total.
2020-03-18 12:26:59 +01:00
Joost Jager
07a39b1ebf cnct: do not persist stateless resolvers
Preparation for the anchor resolver which does not have persistent
state.
2020-03-18 12:26:57 +01:00
Joost Jager
d2b6472843 cnct: pre-confirmation anchor sweep
Start anchor sweep attempts immediately after the commitment transaction
has been published. This makes the anchor known to the sweeper and
allows the user to bump the fee on it to get their commitment
transaction confirmed in case the fee committed too is insufficient for
timely confirmation.
2020-03-18 12:26:55 +01:00
Oliver Gugger
8a9b7595b7 Merge pull request #4094 from guggero/btcd-docker
docker: pin down btcd version
2020-03-18 10:05:21 +01:00
Oliver Gugger
f5f0b2107b docker: pin down btcd version
There was a recent change merged into btcd that isn't backward
compatible with older RPC clients. To make sure our docker quick
start example still works, we need to pin down btcd to the version
that is still compatible with lnd.
2020-03-18 08:54:48 +01:00
Conner Fromknecht
b6a0bfcabe Merge pull request #3848 from carlaKC/htlcnotifier-3-addhtlcnotifierrpc
[htlcnotifier 4/4]: lnrpc: Add HTLC Event Subscription
2020-03-17 16:37:52 -07:00
Conner Fromknecht
5147a6d63d netann/channel_update: set timestamp via modifier 2020-03-17 16:25:22 -07:00
Conner Fromknecht
f6c194c3cd netann/node_announcement: consolidate signing logic 2020-03-17 16:25:02 -07:00
Conner Fromknecht
089ac647d8 discovery/chan_series: use netann.ChannelUpdateFromEdge helper 2020-03-17 16:24:25 -07:00
Conner Fromknecht
7b0d564692 discovery: move remotePubFromChanInfo to gossiper, remove utils 2020-03-17 16:24:10 -07:00
Conner Fromknecht
6a813e3433 discovery/multi: move CreateChanAnnouncement to netann 2020-03-17 16:23:54 -07:00
Conner Fromknecht
d82aacbdc5 discovery/utils: use netann.ChannelUpdateFromEdge 2020-03-17 16:23:37 -07:00
Conner Fromknecht
9d92cfd2b4 netann/channel_update: use generic SignAnnouncement 2020-03-17 16:23:19 -07:00
Conner Fromknecht
df44d19936 discovery/multi: move SignAnnouncement to netann 2020-03-17 16:23:01 -07:00