add new max channel size config option

- let users specify their MAXIMUM WUMBO with new config option which sets the maximum channel size lnd will accept
- current implementation is a simple check by the fundingManager rather than anything to do with the ChannelAcceptor
- Add test cases which verify that maximum channel limit is respected for wumbo/non-wumbo channels
- use --maxchansize 0 value to distinguish set/unset config. If user sets max value to 0 it will not do anything as 0 is currently used to indicate to the funding manager that the limit should not be enforced. This seems justifiable since --maxchansize=0 doesn't seem to make sense at first glance.
- add integration test case to ensure that config parsing and valiation is proper. I simplified the funding managers check electing to rely on config.go to correctly parse and set up either i) non wumbo default limit of 0.16 BTC OR ii) wumbo default soft limit of 10 BTC

Addresses: https://github.com/lightningnetwork/lnd/issues/4557
This commit is contained in:
Calvin Zachman committed 2020-09-14 21:16:32 -05:00
1 parent ffe7c3e626
commit f5fb64e552
10 files changed
+272 -7

No files matched your search

+8
View File
@@ -171,6 +171,14 @@
; channels smaller than this will be rejected, default value 20000.
; minchansize=
; The largest channel size (in satoshis) that we should accept. Incoming
; channels larger than this will be rejected. For non-Wumbo channels this
; limit remains 16777215 satoshis by default as specified in BOLT-0002.
; For wumbo channels this limit is 1,000,000,000 satoshis (10 BTC).
; Set this config option explicitly to restrict your maximum channel size
; to better align with your risk tolerance
; maxchansize=
; The duration that a peer connection must be stable before attempting to send a
; channel update to reenable or cancel a pending disables of the peer's channels
; on the network. (default: 19m0s)