Commit Graph

327 Commits

Author SHA1 Message Date
1f3a5ce0d4 config: export CleanAndExpandPath 2020-05-14 14:37:50 +02:00
bc3909050e multi: rename and export logWriter as RootLogWriter 2020-05-14 14:37:50 +02:00
a56ca0d0cf config: export default values for config file
Variables related to the default configuration file location are
needed if the config parsing is happening externally. We export them
so they don't need to be copied to projects that use lnd as a library.
2020-05-14 14:37:49 +02:00
aba29df84d config: extract config validation
To allow external configuration parsing and validation, this commit
exports the function that checks a configuration for sanity.
Also because we touch the code, we need to fix all linter errors.
2020-05-14 14:37:49 +02:00
d4d10b5c71 config: extract default config into function
To make it easy to extract the configuration parsing out of the main
package, the default config is exported as its own function.
2020-05-14 14:37:49 +02:00
9ed1cd623f config+lncfg: move config structs to lncfg, drop suffix 2020-05-14 14:37:48 +02:00
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
4f6cef83fc config: adds cli configurable --migration-dry-run 2020-05-11 15:38:56 -07:00
9f5f48b20d Merge pull request #4089 from fguisso/acceptor
rpcserver: parameterize acceptortimeout
2020-04-30 19:03:55 -07:00
e8c365dc2e Merge pull request #4207 from ErikEk/tor-socks-control-port-fix
tor: socks and control can not use the same host:port
2020-04-30 19:02:38 -07:00
556e3525ea misc: fix error formatting in multiple files 2020-04-24 19:15:08 +02:00
28eba07b3e tor: socks and control can not use the same host:port 2020-04-20 10:41:19 +02:00
1e3b0672d7 config+lnd+lncli: add commit back to version string 2020-04-14 15:51:44 +02:00
nsa
f1fd5e86c0 config: add WatchtowerKeyPath Tor option
Co-authored-by: Turtle <orbitalturtle@protonmail.com>
2020-03-29 11:54:59 -04:00
97da7b3444 multi: support config bitcoind fee estimate mode 2020-03-25 14:59:23 +08:00
090d56b3a2 config: remove default values from flag descriptions 2020-03-20 01:07:47 +02:00
5ab7dd89e7 rpcserver: parameterize acceptortimeout 2020-03-17 16:43:14 -03:00
e17ad8bc84 Merge pull request #4048 from wpaulino/tor-hashed-password
server+tor: add support for Tor HASHEDPASSWORD authentication method
2020-03-10 11:12:41 -07:00
018e8b5b97 server+tor: add support for Tor HASHEDPASSWORD authentication method
This provides users an alternative over the SAFECOOKIE authentication
method, which may not be as useful if users are connecting to a remote
Tor sevrer due to lnd not being able to retrieve the cookie file.
2020-03-10 10:32:44 -07:00
44756b5811 cfg: rename legacyprotocol to protocol
Since we are also going to use it for experimental new features.
2020-03-09 12:59:34 +01:00
fce472e820 Merge pull request #3876 from breez/allow-timeouted-initiated-htlc
contractcourt: keep channels with timed-out initiated htlcs.
2020-02-17 14:08:44 -08:00
0407b37fce contractcourt+switch: keep channels with timed-out initiated htlcs.
This commit enables the user to specify he is not interested in
automatically close channels with pending payments that their
corresponding htlcs have timed-out.
By requiring a configurable grace period uptime of our node
before closing such channels, we give a chance to the other node to
properly cancel the htlc and avoid unnecessary on-chain transaction.
In mobile it is very important for the user experience as otherwise
channels will be force closed more frequently.
2020-02-16 09:08:03 +02:00
f7a85e07b0 lnd+cert: recreate TLS files if IPs or DNS changed
This commit makes lnd recreate its TLS certificate if the config's
tlsextradomains or tlsextraips changed. This is useful, since earlier
user would have to manually delete the files to trigger lnd to recreate
them.

To ensure users don't accidentally have their TLS certificate recreated,
we gate it behind a flag --tlsautorefresh that defaults to false.
2020-02-12 10:59:51 +01:00
afc7cc7f84 htlcswitch+config: make circular forwarding defence configurable
Add a bool to the switch's config which can be used to disable same
channel circular route checks.
2020-01-30 10:13:47 +02:00
51dbdd3b38 multi: rename key_send, key-send and key send to keysend 2020-01-16 18:37:16 -08:00
1d5844c196 invoices: jit insert key send invoices
This commit adds handling code for the key send custom record. If this
record is present and its hash matches the payment hash, invoice
registry will insert a new invoice into the database "just in time". The
subsequent settle flow is unchanged. The newly inserted invoice is
picked up and settled. Notifications will be broadcast as usual.
2019-12-23 21:51:19 +01:00
b826858a50 config: expose minhtlcout as a config parameter 2019-12-11 00:17:01 +01:00
d8fd6fae23 config+channeldb: describe min_htlc fields more accurately 2019-12-11 00:16:55 +01:00
3b161289ae trivial: typo fix
Correct `diconnecting` to `disconnecting`
2019-12-10 10:13:55 -08:00
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
216b933d9b config+itest: allow unsafe disconnect by default
This commit beings the process of deprecating unsafe-disconnect. Many
moons ago this was disallowed to prevent concurency bugs surrounding
reconnect. Despite the name, it has been safe to enable this feature for
well over a year, as several PRs have been merged that addressed the
possible issues that existed when the feature was added.
2019-11-19 20:13:04 -08:00
0b2ef8bb4e Merge pull request #2813 from wereHamster/tor-target-ip-address
Tor option to override target IP address
2019-10-22 17:15:54 +02:00
3ca2c363fe lnd+rpcserver: initialize new log writer correctly 2019-10-14 14:56:32 +02:00
d3995a73ae build: move log rotator code 2019-10-14 14:56:31 +02:00
3ea74c4362 build: move log level parse code and add new leveled sub logger interface 2019-10-14 14:56:30 +02:00
b63ed5ad56 config: add sync freelist cli flag 2019-10-04 12:19:42 -04:00
e84fe8f947 Merge pull request #3358 from halseth/mainnet-neutrino
config: allow mainnet neutrino
2019-09-25 19:15:48 -07:00
b3669d71e3 Fix typo in config.go 2019-09-24 14:49:59 +02:00
2b7f9a3029 config: fix configfile flags 2019-09-19 17:05:56 -03:00
d9a55334dc config: allow mainnet neutrino 2019-09-17 13:27:19 +02:00
b1fc008433 Tor option to override target ip address 2019-09-14 17:05:32 +02:00
7c85363ef6 config: Add norest config for disabling REST API
This commit adds a new config `norest` for disabling the REST API.
This is useful in cases where it is not needed (i.e lnd running on
mobile devices).
2019-09-09 22:18:38 +02:00
d8dd6b3245 htlcswitch: cap fee updates to max fee allocation
In this commit, we begin to enforce a maximum channel commitment fee for
channel initiators when attempting to update their commitment fee. Now,
if the new commitment fee happens to exceed their maximum, then a fee
update of the maximum fee allocation will be proposed instead if needed.

A default of up to 50% of the channel initiator's balance is enforced
for the maximum channel commitment fee. It can be modified through the
`--max-channel-fee-allocation` CLI flag.
2019-09-03 16:49:59 -07:00
9ef66f568f Merge pull request #2203 from ccdle12/reject-htlc-option
htlcswitch+config+server: adding RejectHTLC flag
2019-08-26 14:53:32 +02:00
653d557fec config: add new legacy protocol build tag protected sub-config for legacy onion
In this commit, we add a new build tag protected sub-config for legacy
protocol features. The goal of this addition is to be able to default to
new feature within lnd, but expose hooks at the config level to allow
integration tests to force the old behavior to ensure that we're able to
support both the old+new versions.
2019-08-22 18:53:08 -07:00
05d0d028bc htlcswitch+config+server: Adds a rejecthtlc flag that disables forwarded
htlcs

config: Adding RejectHTLC field in config struct

This commit adds a RejectHTLC field in the config struct in config.go.
This allows the user to run lnd as a node that does not accept onward
HTLCs.

htlcswitch/switch: Adding a field RejectHTLC to the switch config

This commit adds a field RejectHTLC to the switch config. When the
switch receives an HTLC it will check this flag and if the HTLC is not
from the source hop, the HTLC will be rejected.

htlcswitch/switch: adding check for RejectHTLC flag and incomingChanID

This commit adds a check when receiving UpdateAddHTLC. The check looks
for the RejectHTLC flag set and whether the HTLC is from the sourceHop
(the local switch). If the HTLC is not from the sourceHop, then we
reject the HTLC and return a FailChannelDisabled error.

server: adding RejectHTLC field to initialization of switch

lnd_test: adding test for RejectHTLC

This commit adds a test which tests that a node with the --rejecthtlc
flag will reject any onward HTLCs but still can receive direct HTLCs and
can send HTLCs.
2019-08-20 11:01:44 +01:00
4dd054ae90 multi: remove debug invoices
Debug invoices are rarely used nowadays, but keep asking for maintenance
every time refactoring in primarily the invoice registry occurs. We have
passed the cost/benefit tipping point, so therefore the debug invoice
concept is removed in this commit.

Previously the debughtlc flag also controlled whether hodl masks were
active. It is safe to remove that additional condition because the hodl
masks are still guarded by the dev build tag.
2019-08-14 21:33:03 +02:00
6e9e0eaddd Merge pull request #3359 from cfromknecht/flag-flip-no-historical-gossip
discovery: flag flip no historical gossip
2019-08-02 15:31:33 -07:00
9eb7237a2e Merge pull request #3348 from wpaulino/max-cltv-expiry-config
htlcswitch: make max cltv expiry configurable and lower default
2019-08-02 14:00:17 -07:00
994719026f config+server: add ignore-historical-filters CLI option
This commit adds the ignore-historical-filters CLI option, initially
defaulting to false. Users may use this option to prevent lnd from doing
historical gossip dumps to peers that set their `gossip_timestamp_range`
in the past. Enabling this option will result in lower bandwidth and
memory consumption. Down the road the plan is to make this default to
true.
2019-07-30 17:26:03 -07:00