Commit Graph

106 Commits

Author SHA1 Message Date
carla
2a614cc596
multi: add labels to lnd native transactions
Follow up labelling of external transactions with labels for the
transaction types we create within lnd. Since these labels will live
a life of string matching, a version number and rigid format is added
so that string matching is less painful. We start out with channel ID,
where available, and a transaction "type". External labels, added in a
previous PR, are not updated to this new versioned label because they
are not lnd-initiated transactions. Label matching can check this case,
then check for a version number.
2020-07-29 13:46:07 +02:00
Olaoluwa Osuntokun
8177fed302
funding: allow incoming wumbo channel requests if wumbo is enabled 2020-07-10 16:27:15 -07:00
Wilmer Paulino
9e8c39d4a2
Merge pull request #971 from vctt94/addMaxValueFlag
Add max value in flight flag
2020-07-07 10:29:51 -07:00
nsa
cbd54101f8 multi: remove peer.go, change all references to point to peer pkg 2020-07-06 19:16:07 -04:00
vctt94
2f6a8b13ae fundingmanager: Add max value to fundingmanager and fundingmanager_test 2020-07-03 11:09:40 -03:00
carla
75370ce6b4
multi: update WalletController PublishTransaction to include label
Add label parameter to PublishTransaction in WalletController
interface. A labels package is added to store generic labels that are
used for the different types of transactions that are published by lnd.

To keep commit size down, the two endpoints that require a label
parameter be passed down have a todo added, which will be removed in
subsequent commits.
2020-05-19 13:30:00 +02:00
Olaoluwa Osuntokun
c2516d9352
Merge pull request #4286 from guggero/remove-global-cfg
multi: remove global cfg variable
2020-05-18 19:45:43 -07:00
Olaoluwa Osuntokun
280bf8d26c
Merge pull request #4226 from breez/fix-chainrpc-crash
Fix crash when ChainNotifier is being accessed too early.
2020-05-15 16:17:40 -07:00
Oliver Gugger
7ce70321ac
fundingmgr+server: don't use global cfg 2020-05-14 16:18:01 +02:00
Oliver Gugger
3b2188d689
multi: move exported items to lncfg 2020-05-14 14:37:51 +02:00
Oliver Gugger
409d2c9a90
lnd+config: export config struct and LoadConfig
As a preparation to be moved to the lncfg package, the main struct and
functions related to configuration are exported.
2020-05-14 13:05:01 +02:00
Roei Erez
ae2c37e043 Ensure chain notifier is started before accessed.
The use case comes from the RPC layer that is ready before the
chain notifier which is used in the sub server.
2020-04-30 12:54:33 +03:00
Andras Banki-Horvath
556e3525ea misc: fix error formatting in multiple files 2020-04-24 19:15:08 +02:00
Conner Fromknecht
0f94b8dc62
multi: return input.Signature from SignOutputRaw 2020-04-10 14:27:35 -07:00
Conner Fromknecht
ec784db511
multi: remove returned error from WipeChannel
The linter complains about not checking the return value from
WipeChannel in certain places. Instead of checking we simply remove the
returned error because the in-memory modifications cannot fail.
2020-04-02 17:39:29 -07:00
Oliver Gugger
182835d504
fundingmgr+channelnotifier: add channel config to pending chan ntfn
To be able to write a new channel backup file for pending channels,
we need to include the channel configuration in the pending channel
notification event.
2020-02-14 10:04:26 +01:00
Hampus Sjöberg
227e66c469 rpc: Add PendingOpenChannel to SubscribeChannelEvents
This commit adds PendingOpenChannel to SubscribeChannelEvents stream in
the gRPC API.
This is useful for keeping track of channel openings that Autopilot does.
It can also be used for the non-initator side of a channel opening to keep
track of channel openings.
2020-01-24 13:48:18 +01:00
Joost Jager
ddb98fcc41
multi: distinguish between htlc in and out constraints 2019-12-11 00:16:57 +01:00
carla
9b35c349de
multi: Set upfront shutdown from open and accept chanel messages
This commit gets upfront shutdown scripts from openchannel and
acceptchannel wire messages sent from our peer and sets upfront
shutdown scripts in our open and accept channel messages when
the remote peer supports option upfront shutdown and we have
the feature enabled.
2019-12-03 11:38:29 +02:00
Olaoluwa Osuntokun
7a64a7d3a4
lnwallet: delegate all channel funding logic to the new chanfunding package
In this commit, we begin to integrate the new channel funding package
into the existing codebase. With this set of changes, we'll no longer
construct and sign the funding transaction within this package, instead
delegating it to the new chanfunding package. We use the new
chanfunding.WalletAssembler to carry out all channel funding, providing
it with an implementation of all its interfaces backed by the wallet.
2019-12-02 17:11:36 -06:00
Conner Fromknecht
16318c5a41
multi: merge local+global features from remote peer 2019-11-08 05:31:47 -08:00
Olaoluwa Osuntokun
777ed104a3
chainfee: create new chainfee package extracting fees from lnwallet
In this commit, we create a new chainfee package, that houses all fee
related functionality used within the codebase. The creation of this new
package furthers our long-term goal of extracting functionality from the
bloated `lnwallet` package into new distinct packages. Additionally,
this new packages resolves a class of import cycle that could arise if a
new package that was imported by something in `lnwallet` wanted to use
the existing fee related functions in the prior `lnwallet` package.
2019-10-31 16:41:57 -07:00
Olaoluwa Osuntokun
3f8526a0ca
peer+lnpeer: add new methods to expose local+global features for lnpeer interface 2019-09-25 18:26:01 -07:00
Olaoluwa Osuntokun
b1d122773e
Merge pull request #1910 from halseth/fundingmanager-state-machine
Fundingmanager state machine cleanup
2019-09-25 16:31:51 -07:00
nsa
4d02100e12
fundingmanager+server: adding ChannelAcceptor to the fundingmanager 2019-09-25 12:07:30 -04:00
Johan T. Halseth
30614d3840
funding tests: increase epoch channel buffer
Since the initiator no longer registers for block epochs, we increase
the buffer on the mocked channel to not block during tests.
2019-09-24 21:24:39 +02:00
Johan T. Halseth
5d1a7b0e7d
funding test: correctly send remote peer on connected chan 2019-09-24 21:24:32 +02:00
Johan T. Halseth
0db9045e11
funding test: mark assert methods t.Helper 2019-09-24 21:24:32 +02:00
Johan T. Halseth
33fe09482b
lnwire+multi: define Error() for lnwire.Error
To make lnwire.Error actually satisfy the error interface, define the
Error method directly.
2019-09-20 10:55:21 +02:00
Joost Jager
3d7de2ad39
multi: remove dead code 2019-09-10 17:21:59 +02:00
Johan T. Halseth
0405703019
fundingmanager test: add TestFundingManagerFundAll
TestFundingManagerFundAll tests that we can initiate a funding request to
use the funds remaining in the wallet. This should produce a funding tx with
no change output.
2019-07-18 00:58:12 +02:00
Johan T. Halseth
2cd7d5a2a4
fundingmanager test: extract publishing logic into fundChannel, set funding fee during unit tests 2019-07-18 00:58:12 +02:00
Johan T. Halseth
78da62c6f7
fundingmanager tests: run tests in parallel 2019-07-18 00:33:14 +02:00
Johan T. Halseth
452ee6aad4
fundingmanager+server: define MaxPendingChans. RejectPush in funding config
This commit makes the funding manager access the MaxPendingChannels and
RejectPush values from the fundingConfig instead of the global config
struct.

Done to avoid sharing state between tests.
2019-07-18 00:33:14 +02:00
Federico Bond
9bd3055fb8 discovery,fundingmanager: avoid serialization in NotifyWhenOnline 2019-06-04 16:36:21 -03:00
Joost Jager
dff0387363
lntest: move itest into package 2019-05-28 21:43:23 +02:00
Conner Fromknecht
08654786ad
fundingmanager: bump max non-initiator funding timeout to 2 weeks
The previous value was set to two days, which may not be enough to
handle large fee spikes where users still which to submit channels with
a low fee and don't mind lowering their time preference. Since the
timeout is only applied to channels that we don't initiate, there's real
downside since it's not our funds that are locked up.
2019-05-18 15:21:56 -07:00
Johan T. Halseth
b53899c43c
lnd: rename package main->lnd 2019-04-23 20:57:33 +02:00
Wilmer Paulino
760f38736e
fundingmanager: populate additional edge info after adding to graph
This commit serves as another stop-gap for light clients since they are
unable to obtain the capacity and channel point of graph edges. Since
they're aware of these things for their own channels, they can populate
the information within the graph themselves once each channel has been
successfully added to the graph.
2019-04-18 21:57:40 -07:00
Conner Fromknecht
f39edd8000
peer: add SendMessageLazy 2019-03-05 17:08:22 -08:00
Valentine Wallace
5405028948 fundingmanager: inform ChannelNotifier about newly open channels. 2019-02-05 18:17:54 -08:00
Joost Jager
9e012ecc93
multi: move Input interface and related code
This commit is a step to split the lnwallet package. It puts the Input
interface and implementations in a separate package along with all their
dependencies from lnwallet.
2019-01-31 13:25:33 +01:00
Olaoluwa Osuntokun
b4c5833325
Revert "fundingmanager_test: add TestFundingManagerRejectInvalidMaxValueInFlight"
This reverts commit eb618051208dbd8bb0c160001052b5cc36174888.
2019-01-29 18:31:04 -08:00
Valentine Wallace
4fb1536f54
fundingmanager_test: verify max HTLC in ChannelUpdates
In this commit, we verify that ChannelUpdates for newly
funded channels contain the max HTLC that we expect.
We expect the max HTLC value of each ChannelUpdate to
equal the maximum pending msats in HTLCs required by
the remote peer.

Co-authored-by: Johan T. Halseth <johanth@gmail.com>
2019-01-22 08:42:30 +01:00
Johan T. Halseth
4f9de9bf1d
fundingmanager_test: add TestFundingManagerRejectInvalidMaxValueInFlight 2019-01-22 08:42:30 +01:00
Wilmer Paulino
4f953afeee
lnwallet+fundingmanager: enforce max MinAcceptDepth within funding proposals 2019-01-11 17:05:35 -08:00
Joost Jager
6389a97708
utxonursery: connect to time-based sweeper
Previously, nursery generated and published its own sweep txes. It
stored the sweep tx in nursery_store to prevent a new tx with a new
sweep address from being generated on restart.

In this commit, sweep generation and publication is removed from nursery
and delegated to the sweeper. Also the confirmation notification is
received from the sweeper.
2018-12-18 10:50:20 +01:00
Joost Jager
91f3df07e4
lnwallet: prevent static fee estimator fees from being modified
Modifying the static fees is not thread safe. In this commit the fees
are made immutable.
2018-12-18 10:50:05 +01:00
Olaoluwa Osuntokun
f60012b3f9
Merge pull request #2027 from mrwhythat/no-incoming-push-amounts-option
Option to disable incoming push amounts on channel opening
2018-11-02 17:08:05 -07:00
whythat
6f3adcd490 fundingmanager test: add test for 'rejectpush' option 2018-11-02 01:55:18 +02:00