Commit Graph

109 Commits

Author SHA1 Message Date
Roei Erez
ff172bdd3a proper cleanup neutrino database in case of error 2019-01-28 18:21:26 +02:00
Wilmer Paulino
c72da48111
multi: update to latest ChainNotifier impl New method 2019-01-21 13:57:43 -08: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
b492114016
chainregistry: add the keyRing and walletController to chainControl 2018-12-06 16:25:35 -08:00
Wilmer Paulino
7d94c65afc
Revert "chainregistry: disable height hint cache"
This reverts commit 0e29a457e1f38b2841019dc6664de1697aa84b34.
2018-10-31 09:20:22 -07:00
Wilmer Paulino
2fa64dd6ff multi: update to new BitcoindClient API 2018-09-12 21:05:19 -07:00
Conner Fromknecht
0e29a457e1
chainregistry: disable height hint cache 2018-08-26 15:32:10 -07:00
Wilmer Paulino
4c2a0970b4
chainregistry: modify backends to use a height hint cache 2018-08-21 13:02:15 -04:00
Wilmer Paulino
dae5382fd4
chainregistry: correctly establish connection to bitcoind
In this commit, we fix a bug recently introduced where we would
construct the parameters required to connect to a bitcoind backend, but
never actually started the connection.
2018-08-09 23:29:49 -07:00
Wilmer Paulino
9d2eeb6304
multi: update to latest fee estimation interface 2018-08-09 17:29:52 -07:00
Wilmer Paulino
936fcc1f16
multi: update to latest BitcoindClient interface
In this commit, we introduce a nice optimization with regards to lnd's
interaction with a bitcoind backend. Within lnd, we currently have three
different subsystems responsible for watching the chain: chainntnfs,
lnwallet, and routing/chainview. Each of these subsystems has an active
RPC and ZMQ connection to the underlying bitcoind node. This would incur
a toll on the underlying bitcoind node and would cause us to miss ZMQ
events, which are crucial to lnd. We remedy this issue by sharing the
same connection to a bitcoind node between the different clients within
lnd.
2018-08-08 20:26:30 -07:00
Olaoluwa Osuntokun
71dfb1cdb1
build: update glide to point to latest neutrino+btcwallet 2018-07-13 17:15:13 -07:00
Olaoluwa Osuntokun
6f60f139f4 multi: switch over import paths from roasbeef/* to btcsuite/* 2018-07-13 17:05:39 -07:00
maurycy
ee65605495 chainregistry: fix ActiveChains comment 2018-07-10 16:57:09 -07:00
Oliver Gugger
8f2a8d6682 chainregistry: pass initialized wallet to chain control 2018-06-12 19:27:56 -07:00
Wilmer Paulino
e363766394
multi: increase max funding and payment amount 60x under Litecoin 2018-05-25 00:11:20 -04:00
Conner Fromknecht
1972a795e5
chainregistry: initialize wallet w/ recovery window 2018-04-26 16:03:27 -07:00
Wilmer Paulino
ead9555d40
chainregistry: remove txindex requirement for btcd and bitcoind
Now that we have a fallback method for when the transaction index is not
enabled, its requirement to be enabled for a full node is no longer
needed, so we can safely remove this check.
2018-04-17 14:59:52 -04:00
Olaoluwa Osuntokun
0162b93e13
Merge pull request #957 from cfromknecht/bump-ltc-dust-limit
chainregistery: correct ltc dust limit
2018-03-28 16:10:42 -07:00
ftufek
6c00de1865 neutrino: stop the chainservice before node DB
When in neutrino mode, it seems that the node is not closed during the cleanup, so if a block is received between the time the DB is closed and the server is closed (or if the process is still running after the server is shutdown like on a mobile app), the code panic's and crashes with:

panic: unable to write block header: database not open
goroutine 41 [running]:
github.com/lightningnetwork/lnd/vendor/github.com/lightninglabs/neutrino.(*blockManager).handleHeadersMsg(0x9a1ec0a0, 0x9a3e6030)
/ext-go/1/src/github.com/lightningnetwork/lnd/vendor/github.com/lightninglabs/neutrino/blockmanager.go:1164 +0x2224
github.com/lightningnetwork/lnd/vendor/github.com/lightninglabs/neutrino.(*blockManager).blockHandler(0x9a1ec0a0)
/ext-go/1/src/github.com/lightningnetwork/lnd/vendor/github.com/lightninglabs/neutrino/blockmanager.go:347 +0x3b4
created by github.com/lightningnetwork/lnd/vendor/github.com/lightninglabs/neutrino.(*blockManager).Start
/ext-go/1/src/github.com/lightningnetwork/lnd/vendor/github.com/lightninglabs/neutrino/blockmanager.go:200 +0xe8


Here's a log of shutdown before the change:
[INF] LTND: Gracefully shutting down the server...
[INF] FNDG: Funding manager shutting down
[INF] SPHX: Block epoch canceled, decaying hash log shutting down
[INF] CRTR: Channel Router shutting down
[INF] CRTR: FilteredChainView stopping
[INF] HSWC: HTLC Switch shutting down
[INF] UTXN: UTXO nursery shutting down
[INF] BRAR: Breach arbiter shutting down
[INF] DISC: Authenticated Gossiper is stopping
[INF] CNCT: Stopping ChainArbitrator
[INF] LTND: Shutdown complete


And here's a log of shutdown after the change:
[INF] LTND: Gracefully shutting down the server...
[INF] FNDG: Funding manager shutting down
[INF] SPHX: Block epoch canceled, decaying hash log shutting down
[INF] CRTR: Channel Router shutting down
[INF] CRTR: FilteredChainView stopping
[INF] HSWC: HTLC Switch shutting down
[INF] UTXN: UTXO nursery shutting down
[INF] BRAR: Breach arbiter shutting down
[INF] DISC: Authenticated Gossiper is stopping
[INF] CNCT: Stopping ChainArbitrator
[INF] LTND: Shutdown complete
[INF] BTCN: Block manager shutting down
[INF] BTCN: Address manager shutting down
2018-03-28 15:18:07 -07:00
Conner Fromknecht
8fd7b38e05
chainregistery: correct ltc dust limit
Corrects the ltc dust limit, making it 54600.
2018-03-28 01:02:07 -07:00
Olaoluwa Osuntokun
8f4a8fcf57
chains: add DNS seeds for mainnet BTC and LTC 2018-03-15 02:00:19 -07:00
Olaoluwa Osuntokun
68f842d90b
chains: add genesis hashes for BTC and LTC mainnet 2018-03-15 01:58:35 -07:00
Olaoluwa Osuntokun
620b552413
chains: switch to new DNS seed for bitcoin testnet
In this commit we switch over to the new DNS seed for Bitcoin’s
testnet. This seed will only serve active nodes that are found on
Bitcoin’s testnet.
2018-03-14 18:27:24 -07:00
Olaoluwa Osuntokun
0cd2448f49 chains: specify that current btc+ltc genesis hashes are for testnet 2018-03-14 18:24:26 -07:00
Conner Fromknecht
5f7a62913f
chainregistry: generalize bitcoind logic to handle litecoind 2018-03-14 16:57:37 -07:00
Conner Fromknecht
2447f3097f
chainregistry: init secret key ring wth CoinType from params 2018-03-13 16:33:45 -07:00
Olaoluwa Osuntokun
9981c4ce38
lnd: populate the secret key ring in the lnwallet config 2018-03-06 16:04:05 -05:00
Johan T. Halseth
6d5c0679f4
chainregistry: express fee rates in sat/vbyte 2018-02-26 22:42:25 +01:00
Olaoluwa Osuntokun
3fcce9959b
lnd: pass through the custom dialer+DNS to neutrino
In this commit, we modify our initialization of neutrino to also pass
in the custom dialer and name resolver function. With this change, if
lnd is configured to use Tor, then neutrino will as well. This means
that *both* the Bitcoin P2P as well as the Lightning P2P traffic will
be proxied over Tor.
2018-02-09 12:16:17 -08:00
Conner Fromknecht
d0afac0407 chainregistry: move neutrino database to chain dir 2018-01-31 17:37:08 -08:00
Alex
9a02884d0b main/lntest: factor out node config options, add options for bitcoind
This commit factors out the btcd and ltcd options into their own sections
similar to neutrino, and adds a bitcoind section as well. Now, you specify
node options similarly to:

--ltcd.rpchost=...
or
--btcd.rpcuser=...
or
--bitcoind.zmqpath=...

For Bitcoin, you specify an alternate back-end to btcd as follows:

--bitcoin.node=bitcoind
or
--bitcoin.node=neutrino

You can also specify the default option:
--bitcoin.node=btcd

For Litecoin, only `btcd` mode is valid, and corresponds to the `ltcd`
section. For example:

--litecoin.node=btcd
--ltcd.rpchost=...

The new code also attempts to read the correct options and auth info
from bitcoin.conf just as it does from btcd.conf/ltcd.conf.
2018-01-15 13:59:34 -08:00
Johan T. Halseth
10bd46ac72
chainregistry: use forwarding policy rules from config
This commit removes the definitions of
defaultBitcoinForwardingPolicy and defaultLitecoinForwardingPolicy
from the the chainregistry, and instead creates a routingPolicy
from the values found in the config.
2018-01-12 22:56:44 +01:00
Olaoluwa Osuntokun
f50b911ebc lnd: if using btcd backend, ensure that --txindex is active
In this commit, we add a new runtime assertion to ensure that the
backed btcd node (if this mode is active) has the proper indexes set
up. Atm, if btcd isn’t running with the txindex active, then the
current ChainNotifier implementation will be unable to properly handle
certain classes of historical notification dispatches.

In order to test that the running btcd node is configured properly,
we’ll fetch the latest block, then try to query a transaction within
that block using the txindex. If btcd isn’t running with this mode
active, then the request will fail. In this case, we’ll then fail to
start lnd with an error.

Fixes #525.
2018-01-08 19:47:37 -08:00
Olaoluwa Osuntokun
a036098e36
chains: increase default MInHTLC value to 1000 mSAT (1 SAT) 2017-12-13 17:10:30 -08:00
Olaoluwa Osuntokun
30b4ab2c74
chains: use proper genesis hash for Bitcoin's testnet 2017-12-02 18:04:08 -08:00
Olaoluwa Osuntokun
4d6cd2ee36
chain: the default minHTLC policy is now 1 2017-11-30 22:54:39 -08:00
Olaoluwa Osuntokun
f4f476fe9f
chainregistry: also disable fee estimation for regtest 2017-11-29 16:15:09 -08:00
Olaoluwa Osuntokun
ad364ae9a1
chains+server: if not in simnet mode, use BtcdFeeEstimator 2017-11-23 23:10:12 -06:00
Olaoluwa Osuntokun
991a2fbb5f
chainregistry: add shim for TCP fallback for current DNS seed 2017-10-30 19:02:56 -07:00
Olaoluwa Osuntokun
8358349b2d
lnd: revert back to prior default wallet public passphrase
In this commit we ensure the behavior of lnd with the —noencryptwallet
command line option heaves as it did before user initiated wallet
encryption was implemented. We do this by modifying the
waitForWalletPassword method to instead return two pass phrases: one
public and one private. The default wallet public passphrase is then
restarted back to the value which was used stoically in the codebase
before the latest merged PR.
2017-10-19 19:53:28 -07:00
Johan T. Halseth
62dc6b81d2 chainregistry: take wallet password as parameter to newChainControlFromConfig
This let the caller of newChainControlFromConfig set the password
to be used when creating or unlocking the wallet database. The
provided password is used both as private and public password.
2017-10-19 19:17:35 -07:00
Olaoluwa Osuntokun
fe0a7b6a09
multi: fix linter errors 2017-09-03 17:05:11 -07:00
Olaoluwa Osuntokun
74ef963124
chains: add a set of BOLT-0010 DNS seeds for bitcoin 2017-09-03 16:53:33 -07:00
Olaoluwa Osuntokun
d5cc0441f4
chains: use distinct StaticFeeEstimator instances for Bitcoin and Litecoin 2017-09-03 16:53:09 -07:00
Olaoluwa Osuntokun
9f0efddc20
multi: switch from btcrpcclient to rpcclient 2017-08-24 18:54:24 -07:00
Olaoluwa Osuntokun
5fa345310b
chain: set default fees to min possible 2017-08-22 00:52:36 -07:00
Olaoluwa Osuntokun
16462e1d57
chains: specify a default CLTV expiration of 1 day equiv for each chain 2017-08-02 21:18:54 -07:00
Olaoluwa Osuntokun
a73589f3e9
lnd: properly initialize LightningWallet with new config 2017-07-30 17:52:07 -07:00
Olaoluwa Osuntokun
89537318c1
chains: add default routing policy for current supported blockchains 2017-06-17 00:12:43 +02:00
Olaoluwa Osuntokun
dc40662770
lnwallet/btcwallet: properly pass in FeeEstimator to btcwallet
This commit fixes a bug wherein the wallet would use the default relay
fee to craft transactions. On testnet, this might be insufficient or be
rejected all together in a mainnet setting. Therefore, we now pass in
the FeeEstimator interface and ensure that it’s consulted in order to
set the relay fee the wallet will use to craft transactions.

Note that this is a hold over until we have true dynamic fee
calculation within lnd which can then be extended to the internal
wallets.
2017-06-07 17:01:27 -07:00
Olaoluwa Osuntokun
9fd70958f4
multi: fix linter errors 2017-06-05 19:45:01 -07:00
Olaoluwa Osuntokun
cbf7cd48f5
multi: update to latest neutrino API changes 2017-06-05 19:41:07 -07:00
Olaoluwa Osuntokun
4b29c70c45
lnd: rename light client cmd line option to --neutrino.X=K 2017-06-05 19:23:09 -07:00
Olaoluwa Osuntokun
593ba7c8f0
lnd: newChainControlFromConfig can now create light client backed chainControl
This commit finishes up the implementation of newChainControlFromConfig
in order to properly initiate the members of the chainControl struct
when the new light client mode (neutrino). With this lnd is now able to
switch over to either mode with a simple configuration change.
2017-06-05 19:14:41 -07:00
Alex
7859f4fcc6 chainregistry: change data dir for address manager 2017-06-05 18:54:22 -07:00
Alex
d5130909d4 chainregistry: create neutrino DB in correct directory 2017-06-05 18:54:16 -07:00
Olaoluwa Osuntokun
770d6b136f
chainregistry: add new method to automatically create chainControl 2017-06-05 18:48:12 -07:00
Olaoluwa Osuntokun
04d0e099cc
lnd: add new chainRegistry struct for multi-chain dispatch
This commit adds a new agent to the codebase: the chainRegistry. In a
multi-chain future, the chainRegistry will be the dispatch point
capable of mapping cross-chain parameters, and a particular chain to
the chainControl for that chain. The chainControl struct encompasses
the 3 primary interfaces used within the daemon to register for events,
and drive other workflows.
2017-05-02 19:57:46 -07:00