Commit Graph

90 Commits

Author SHA1 Message Date
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
Wilmer Paulino
85cdb18b73
fundingmanager: send NodeAnnouncement to unadvertised channel counterparty
In this commit, we modify the funding manager to send our
NodeAnnouncement to our channel counterparty in the event of an
unadvertised channel. We do this to ensure that our counterparty learns
about some information about us that may aid them in one way or another
(e.g., addresses to reconnect, features supported, etc.).
2018-10-24 19:20:01 -07:00
Conner Fromknecht
10b35a8f20
main: remove disable log in testing + clean up imports 2018-10-05 13:04:45 +09:00
Johan T. Halseth
a433e70575
fundingmanager test: satisfy new interfaces 2018-09-28 09:05:01 +02:00
maurycy
ac24b12bf2
multi: fix various typos in comments 2018-09-07 06:51:49 +02:00
Olaoluwa Osuntokun
19552b0dbf
htlcswitch+funding+discovery: update mock peers to add new QuitSignal method 2018-08-25 17:30:15 -07:00
Olaoluwa Osuntokun
a1a6845fb5
Merge pull request #1731 from halseth/link-policy-persist
Correctly apply min_htlc to forwarding policy
2018-08-23 19:21:44 -07:00
Johan T. Halseth
e069dd7f04
fundingmanager test: test that custom MinHTLC is in ChannelUpdate 2018-08-23 07:50:17 +02:00
Johan T. Halseth
6a6d3ff557
funding tests: account for returned err channel 2018-08-23 07:40:41 +02:00
Valentine Wallace
1ffc3bb82e
multi: update to latest RegisterBlockEpochNtfn interface 2018-08-10 01:08:57 -07:00
Olaoluwa Osuntokun
d2612e51bd
Merge pull request #1644 from wpaulino/kw-fees
multi: switch to sat/kw fees
2018-08-09 20:19:28 -07:00
Olaoluwa Osuntokun
d64bb5921e
Merge pull request #1635 from halseth/funding-broadcast-fail
Move funding tx broadcasting to Fundingmanager
2018-08-09 20:04:30 -07:00
Wilmer Paulino
9d2eeb6304
multi: update to latest fee estimation interface 2018-08-09 17:29:52 -07:00
Olaoluwa Osuntokun
40806532c7
funding: fix import paths for test 2018-07-31 21:29:03 -07:00
Olaoluwa Osuntokun
067db8572c
test+lnd: update unit test mocks to adhere to new interface API's 2018-07-31 21:28:58 -07:00
Olaoluwa Osuntokun
8aef43360f
funding: update fundingManager to register for conf's using pkScripts 2018-07-31 21:28:51 -07:00
Johan T. Halseth
b437d03174
fundingmanager test: add TestFundingManagerMaxPendingChannels 2018-07-31 14:53:22 +02:00