Commit Graph
100 Commits
Author SHA1 Message Date
Olaoluwa Osuntokun 28a59362d6 peer: ensure readHandler doesn't block on AddMsg to msgStream
In this commit, we add a quit channel to the AddMsg method of the
msgStream struct. Before this commit, if the queue was full, the
readHandler would block and be unable to exit. We remedy this by
leveraging the existing quit channel of the peer as an additional select
case within the AddMsg method.
2018-08-26 20:02:50 -07:00
Olaoluwa Osuntokun 26f68da5b2 Merge pull request #1785 from Roasbeef/ensure-peer-quit
peer+server: ensure the peer is always able to quit even mid msgStream application
2018-08-25 18:24:12 -07:00
Olaoluwa Osuntokun f2db18733b peer: before and after obtaining link for chan update, check quit signal 2018-08-25 17:30:17 -07:00
Olaoluwa Osuntokun 13a6d413ac discovery: select on peer's QuitSignal to allow caller to unblock if disconnecting
In this commit, we select on the peer's QuitSignal to allow the caller
to unblock if the peer itself is disconnecting. With this change, we now
ensure that it isn't possible for a peer to block on this method and
prevent a graceful exit.
2018-08-25 17:30:16 -07: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 7f480f723c peer: add QuitSignal to ensure peer struct adheres to lnpeer.Peer interface 2018-08-25 17:30:14 -07:00
Olaoluwa Osuntokun 1364dca5a6 lnpeer: extend Peer interface with new QuitSignal method
In this commit, we extend the Peer interface with a new QuitSignal
method. This method is meant to expose a read-only quit channel which
will allow callers to cancel any actions based on the lifetime of the
underlying peer.
2018-08-25 17:30:13 -07:00
Olaoluwa Osuntokun 169cb723ce build: update dep for golang.org/x/crypto to compile under golang 1.11 2018-08-25 17:30:12 -07:00
Olaoluwa Osuntokun 0e510c8b5c funding+peer: don't attempt to deliver messages if the peer is shutting down 2018-08-25 17:30:11 -07:00
Olaoluwa Osuntokun d6f534cfa5 peer: don't attempt to re-enable any private channels 2018-08-25 17:30:09 -07:00
Olaoluwa Osuntokun 745cc3a8f4 server: don't attempt to disable private channels 2018-08-25 17:30:08 -07:00
Olaoluwa Osuntokun 5130949604 peer: allow msgConsumers to also exit on peer quit send 2018-08-25 17:30:07 -07:00
Olaoluwa Osuntokun 33c5c9661e peer: allow msgStream goroutines to quit within the apply function
In this commit, we thread through the quit of the peer to the execution
of the apply function for a msgStream. This change ensures that if the
target is still processing the message, then the peer is able to exit
cleanly and not block insensately.
2018-08-25 17:30:05 -07:00
Olaoluwa Osuntokun 0b5a403fce funding: add caller quit channel to waitUntilChannelOpen
In this commit, we add a caller quit channel to waitUntilChannelOpen.
This ensures that the caller won't block forever if it needs to exit
before the funding manager exits, or the channel barrier is actually
closed.
2018-08-25 17:30:04 -07:00
Olaoluwa Osuntokun e4e4a6ab58 peer: move atomic var increment in msgConsumer goroutine to defer
In this commit we move the atomic var increment that signals the
consumer goourtine has exited to the top of the method in a defer
statement. This cleans up some duplicate code and also adheres to the
pattern of using defers to signal cleaning up any dependent goroutine
state on exit.
2018-08-25 17:30:02 -07:00
Olaoluwa Osuntokun a7656454aa peer: stop chanMsg streams in defer right after creation 2018-08-25 17:29:59 -07:00
Olaoluwa Osuntokun ce115a6a59 peer: raise readHandler wait group done to defer statement
In this commit, we raise the readHandler wait group done into a defer
statement at the top of the method. This fixes an existing but that
would cause the readHandler to declare it had exited, yet possibly still
be waiting on the chan message stream below to exit.
2018-08-24 18:53:28 -07:00
Olaoluwa Osuntokun 5cf911a762 Merge pull request #1764 from cfromknecht/isolate-fwdpkg-to-live-links
htlcswitch/link: only resovle+gc fwdpkgs for live channels
2018-08-24 17:42:44 -07:00
Olaoluwa Osuntokun c41ea4818c Merge pull request #1769 from cfromknecht/increase-fwdpkg-gc-test-interval
htlcswitch/test_utils: increase fwdpkg gc interval
2018-08-24 17:01:28 -07:00
Olaoluwa Osuntokun d90b5992a3 Merge pull request #1778 from cfromknecht/txindex-proper-fallback
Txindex proper fallback
2018-08-24 14:50:39 -07:00
Olaoluwa Osuntokun 85c0dd3de0 routing/chainview: update to latest API changes 2018-08-24 03:36:25 -07:00
Olaoluwa Osuntokun 9b6b78a932 chainntnfs/neutrinonotify: update to latest API changes 2018-08-24 03:36:25 -07:00
Olaoluwa Osuntokun e718016464 build: update btcd+btcwallet+neutrino to latest versions 2018-08-24 03:36:25 -07:00
Olaoluwa Osuntokun 625b210f44 Merge pull request #1776 from cfromknecht/autopilot-add-node-trigger
[autopilot]: add OnNodeUpdate trigger
2018-08-23 20:35:34 -07:00
Olaoluwa Osuntokun b9db220e8c config: properly show list of sub-systems for show debuglevel
Fixes #1772.
2018-08-23 19:48:30 -07:00
Olaoluwa Osuntokun de92dac6a8 lnwallet: fix logging message for fee floor 2018-08-23 19:38:13 -07:00
Olaoluwa Osuntokun fa6a0a7ce9 lnwire: recognize required query sync feature bit 2018-08-23 19:36:17 -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
Olaoluwa Osuntokun 8de84c4576 Merge pull request #1754 from halseth/fndmgr-gossiper-handoff
Unify gossiper and router announcement handling
2018-08-23 18:44:37 -07:00
Olaoluwa Osuntokun dadf13e2a3 cmd/lncli: rename parseArgs to extractPathArgs, return error 2018-08-23 18:05:24 -07:00
Olaoluwa Osuntokun ebc9550a1b cmd/lncli: properly parse cert and macaroon paths for all config variants
In this commit, we ensure that we're able to properly parse the cert and
macaroon paths for all relevant config variants. Before this commit, it
would be the case that the macaroon path ended up empty if a user wasn't
running the default (mainnet, lnddir) settings. In this commit, we
remedy this by parsing each of the two (cert+macaroon) paths
independently.
2018-08-23 18:05:23 -07:00
Olaoluwa Osuntokun 3d4843ed6c docker: update docker README to account for recent lncli/macaroon changes 2018-08-23 18:05:23 -07:00
Olaoluwa Osuntokun 4d74fa32a9 config: update comment for network directory 2018-08-23 18:05:22 -07:00
Olaoluwa Osuntokun 646e81262f Merge pull request #1771 from halseth/contractcourt-handoff-coop-trigger
[contractcourt] add coopCloseTrigger on startup for pendingClose channel
2018-08-23 16:19:55 -07:00
Olaoluwa Osuntokun 47788c3cec Merge pull request #1696 from halseth/contractcourt-handoff3
contractcourt handoff 2
2018-08-22 21:41:50 -07:00
Olaoluwa Osuntokun 4f20905ac1 Merge pull request #1719 from cfromknecht/duplicate-payments
Control Tower: Sender-side checks for duplicate payments #2
2018-08-22 21:22:38 -07:00
Olaoluwa Osuntokun c9bead7c21 Merge pull request #1278 from wpaulino/persistent-chain-notifiers
chainntnfs: introduce persistent height hint layer to ChainNotifier implementations
2018-08-22 21:02:27 -07:00
Olaoluwa Osuntokun 9f4685228e Merge pull request #1763 from valentinewallace/listinvoices-pagination
channeldb+rpc: add pagination of listinvoices
2018-08-21 20:14:18 -07:00
Olaoluwa Osuntokun f028eaa152 Merge pull request #1698 from cfromknecht/switch-fwdpkg-cleanup
[htlcswitch] fwdpkg cleanup
2018-08-21 18:56:15 -07:00
Olaoluwa Osuntokun e5a61183b5 Merge pull request #1757 from cfromknecht/parallel-link-shutdown
htlcswitch/switch: shutdown links concurrently
2018-08-21 17:17:24 -07:00
Olaoluwa Osuntokun cad8b8edfd Merge pull request #1747 from cfromknecht/fwdpkg-add-cleanup
[htlcswitch]: Set AddRef on failed packets
2018-08-20 20:04:03 -07:00
Olaoluwa Osuntokun dddda7e0f1 Merge pull request #1748 from cfromknecht/relax-circuit-deletion
[htlcswitch]: Relax Circuit Deletion
2018-08-20 18:42:58 -07:00
Olaoluwa Osuntokun 21841c9f6b Merge pull request #1749 from cfromknecht/htlcswitch-code-health
[htlcswitch]: improve code health of switch
2018-08-19 17:40:26 -07:00
Olaoluwa Osuntokun 3f5ec99330 server: properly unlock within openchannel if peer not found 2018-08-18 18:17:55 -07:00
Olaoluwa Osuntokun 147596047f Merge pull request #1687 from halseth/disable-inactive-channels
Send ChannelUpdate with Disabled bit if channel inactive for 20 minutes
2018-08-17 18:04:19 -07:00
Olaoluwa Osuntokun 4c51f9b5ae Merge pull request #1693 from wpaulino/autopilot-zero-conf-inputs
multi: allow use of unconfirmed outputs for funding transactions
2018-08-17 17:06:09 -07:00
Olaoluwa Osuntokun 86e2e3fe2e Merge pull request #1608 from halseth/htlc-expiry-off-by-one
contractcourt/contract_resolvers: correct off-by-one HTLC expiry
2018-08-17 16:41:42 -07:00
Olaoluwa Osuntokun 9c4d069dbc Merge pull request #1742 from halseth/remove-render-option
Remove --render option from `lncli describegraph`
2018-08-17 16:06:50 -07:00
Olaoluwa Osuntokun c6318eb614 Merge pull request #1741 from halseth/autopilot-no-dc
autopilot: check if already connected before returning error
2018-08-17 14:11:58 -07:00
Olaoluwa Osuntokun 643618b4f6 Merge pull request #1694 from wpaulino/autopilot-reachability-test
autopilot: add peer reachability test before tracking funding as pending
2018-08-16 20:18:49 -07:00
Olaoluwa Osuntokun fb927442c5 Merge pull request #1739 from Roasbeef/graph-private-chan-node-cleanup
channeldb: ensure we remove update index entries for nodes upon deletion
2018-08-16 19:20:00 -07:00
Olaoluwa Osuntokun 9353ab00b1 channeldb: ensure that we remove update index entries for nodes upon deletion 2018-08-16 18:22:55 -07:00
Olaoluwa Osuntokun 06d03b55a3 channeldb: add new TestNodePruningUpdateIndexDeletion test
In this commit, we add a new test to expose a lurking bug within the
graph database code. As is, when we go to delete a node from the
database, we don't also remove the entries within the update index. As a
result, if a user attempted to call NodeUpdatesInHorizon (or typically
as part of the p2p handshake), we would error out, as we would try to
read a node that no longer existed in the graph, as it was pruned.
2018-08-16 18:20:58 -07:00
Olaoluwa Osuntokun 4492cb934f Merge pull request #1732 from wpaulino/no-macaroons-change-password
walletunlocker: avoid returning error if macaroon files don't exist
2018-08-16 17:15:12 -07:00
Olaoluwa Osuntokun 90cdc9da8f channeldb: add String() method for EdgePoint
In this commit we fix a minor logging artifact. After the switch to
EdgePoint, the FilteredChainView implementations will try to log the
struct directly, as prior they would have an outpoint object. We restore
this behavior by adding a String() method to EdgePoint which will simply
proxy through to the outpoint so we can log that directly.
2018-08-15 21:43:39 -07:00
Olaoluwa Osuntokun bd62ef6411 funding: properly log pubkey of peer within handleInitFundingMsg
Before this commit, we would log the struct of the pubkey, rather than
the serialized compressed version.
2018-08-15 21:41:53 -07:00
Olaoluwa Osuntokun 4731e1a3e2 Merge pull request #1692 from wpaulino/unadvertised-autopilot
autopilot+config: support opening private channels with autopilot agent
2018-08-15 21:26:05 -07:00
Olaoluwa Osuntokun 15eededf45 Merge pull request #1658 from cfromknecht/async-peer-start
[server]: Start Peers Asynchronously
2018-08-15 20:49:56 -07:00
Olaoluwa Osuntokun fc8626c806 Merge pull request #1726 from Roasbeef/fix-closed-chan-summaries-and-chancfg
multi: ensure closed channel summaries are fully populated, ensure KeyLocators are always set
2018-08-15 20:11:01 -07:00
Olaoluwa Osuntokun b59139f533 build: update to latest version of neutrino 2018-08-15 16:14:28 -07:00
Olaoluwa Osuntokun 917f929e70 keychain: use t.Helper() instead of manually fetching the line no from the runtime 2018-08-15 16:14:02 -07:00
Olaoluwa Osuntokun 1ff596ecd7 build: update btcwallet to point to latest version 2018-08-14 19:11:42 -07:00
Olaoluwa Osuntokun 26032f5956 channeldb: extend TestFetchClosedChannels to populate local chan cfg properly 2018-08-14 19:11:41 -07:00
Olaoluwa Osuntokun cf06b041a4 keychain: extend TestKeyRingDerivation to check KeyLocators of derived keys 2018-08-14 19:11:41 -07:00
Olaoluwa Osuntokun ad25ae1a07 keychain: ensure we properly set the KeyLocator for keys from DeriveNextKey
In this commit, we fix a slight bug in the existing implementation of
DeriveNextKey for btcwallet. Before this commit, we would only set the
public key, and not also the derivation path. It's important that we
also set the path information, as in the near future we'll be using the
KeyDescriptors returned from this method to create static channel back
ups. With these static backups, the key alone may be insufficient to
re-derive the private key as we may need to fallback to brute forcing in
order to re-derive the key as it's possible we add new key families in
the future.
2018-08-14 19:11:40 -07:00
Olaoluwa Osuntokun e97e4c1f5d contractcourt: set auxiliary chan recovery info for all created chan close summaries 2018-08-14 19:11:40 -07:00
Olaoluwa Osuntokun c37c9db2de funding: properly set auxiliary channel recovery info in close chan summaries 2018-08-14 19:11:40 -07:00
Olaoluwa Osuntokun b06dabfcb9 lnwallet: properly set auxiliary channel recovery info in NewUnilateralCloseSummary
In this commit, we fix a slight bug by ensuring that the revocation info
at the final state of the channel, as well as the local chan config is
properly set within the channel close summary created within
NewUnilateralCloseSummary. Before this commit, for all cooperative close
transactions, this state would _only_ include the pubkey itself, which
in some cases may not be sufficient to re-derive the key if needed.
2018-08-14 19:11:18 -07:00
Olaoluwa Osuntokun 999f4a742c Merge pull request #1460 from rawtxapp/lncli-confirm-payreq
Adds extra confirmation to payinvoice and sendpayment, can be bypassed by force.
2018-08-14 16:48:53 -07:00
Olaoluwa Osuntokun 7a113d469b Merge pull request #1551 from cfromknecht/switch-revert-replace-link
[htlcswitch]: revert replace link, ensure removed links are stopped
2018-08-13 21:44:42 -07:00
Olaoluwa Osuntokun 5efc1229bf Merge pull request #1439 from valentinewallace/historical-block-epoch-ntfns
Historical block epoch ntfns
2018-08-13 21:18:36 -07:00
Olaoluwa Osuntokun 35363ee9a8 Merge pull request #1725 from wpaulino/manual-fee-floor
rpcserver: enforce fee floor for fee rates input by the user
2018-08-13 21:03:37 -07:00
Olaoluwa Osuntokun 72aa79692c Merge pull request #1722 from halseth/chan-status-print
peer: print ChanStatus return value, not address
2018-08-12 20:56:47 -07:00
Olaoluwa Osuntokun 6989316b11 Merge pull request #1717 from wpaulino/start-bitcoind-conn
chainregistry: correctly establish connection to bitcoind
2018-08-10 01:07:07 -07:00
Olaoluwa Osuntokun 536a381b4c Merge pull request #1716 from cfromknecht/makefile-definition-order
Makefile: reorder definitions before include + proper tabbing
2018-08-10 00:57:46 -07:00
Olaoluwa Osuntokun c520f89229 Revert "Makefile: run coverage tests with -tags=debug"
This reverts commit 8bb4337cac.
2018-08-09 22:37:30 -07:00
Olaoluwa Osuntokun f4849b051d ticker: fix linter error 2018-08-09 22:15:41 -07:00
Olaoluwa Osuntokun c35a701724 ticker: remove debug build tag from mock.go 2018-08-09 22:08:40 -07:00
Olaoluwa Osuntokun 61f5b3e3f1 Merge pull request #1709 from Empact/noisedial
Move noiseDial from config.go to server.go
2018-08-09 21:43:37 -07:00
Olaoluwa Osuntokun 518b0d2cf7 Merge pull request #1679 from cfromknecht/move-linter-v2
Makefile: move linter v2
2018-08-09 21:03:05 -07:00
Olaoluwa Osuntokun d5863d03ae Merge pull request #1660 from lightningnetwork/fetch-allll-channels
channeldb/db: return all channels if multiple chains exist
2018-08-09 20:59:28 -07:00
Olaoluwa Osuntokun ecf009a4ef Merge pull request #1712 from cfromknecht/run-coverage-with-debug-tag
Makefile: run coverage tests with -tags=debug
2018-08-09 20:58:31 -07:00
Olaoluwa Osuntokun d3b1b9aa98 Merge pull request #1668 from cfromknecht/interface-tickers
Ticker Package
2018-08-09 20:55:25 -07:00
Olaoluwa Osuntokun 3438baaf0c routing: eliminate nested db transactions by using new FetchOtherNode method 2018-08-09 20:48:06 -07:00
Olaoluwa Osuntokun 0f3c0ccf85 channeldb: add new FetchOtherNode method to ChannelEdgeInfo
In this commit, we add a new method to the ChannelEdgeInfo that will
allow the path finding logic to get the node opposite the pivot node
without first creating a new db transaction. The new method is able to
use an existing db transaction, or create a new one if needed.
2018-08-09 20:47:01 -07:00
Olaoluwa Osuntokun ce7bfae4f7 channeldb: ensure we always check error from fetchChanEdgePolicy 2018-08-09 20:46:04 -07:00
Olaoluwa Osuntokun 0109672835 channeldb: add new db field for ChannelEdgeInfo to allow new methods 2018-08-09 20:45:39 -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
Olaoluwa Osuntokun cc6348088c Merge pull request #1714 from Roasbeef/update-btcd-neutrino-fix
build: update to use latest btcd
2018-08-09 18:27:20 -07:00
Olaoluwa Osuntokun bf4283f069 build: update to use latest btcd
In this commit, we update the set of deps to use the latest version of
btcd. Namely this version fixes a bug in re-org handling logic, ensures
that btcd will always respond to getheaders (fixes #511), and also
ensure that it will properly respond to cfheaders messages which is
required for the neutrino sync to operate smoothly.
2018-08-09 17:15:41 -07:00
Olaoluwa Osuntokun 30b156c706 Merge pull request #1566 from wpaulino/bitcoind-rescan-client
multi: share the same bitcoind connection between multiple rescan clients
2018-08-09 17:10:57 -07:00
Olaoluwa Osuntokun bb310a3d0d Merge pull request #1681 from cfromknecht/lock-chain-arb-shutdown
contractcourt/chain_arbitrator: fix potential shutdown race
2018-08-08 22:03:53 -07:00
Olaoluwa Osuntokun 61681a59eb Merge pull request #1705 from Roasbeef/neutrino-update
build: update neutrino to latest version
2018-08-08 20:22:08 -07:00
Olaoluwa Osuntokun 97f9759ee1 Merge pull request #1675 from cfromknecht/peer-backoff-backoff
server: peer backoff backoff
2018-08-08 20:03:28 -07:00
Olaoluwa Osuntokun 8a56b33aa6 Merge pull request #1702 from wpaulino/peer-bootstrapper-backoff
server: prevent increasing epochErrors if conn was established
2018-08-08 19:54:54 -07:00
Olaoluwa Osuntokun 31117e6b30 lnwallet: lower timeout for waitForWalletSync back to 10s 2018-08-08 19:48:21 -07:00
Olaoluwa Osuntokun a368205fc6 build: update to latest version neutrino
In this commit, we update to the latest version of neutrino. This
version contains a number of bug fixes, and optimizations. Additionally
this version will allow the lnwallet re-org tests to once again pass
reliably on Travis.
2018-08-08 19:48:01 -07:00
Olaoluwa Osuntokun 8379bbaa9b Merge pull request #1673 from cfromknecht/prevent-db-reversions
channeldb: fail Open on db reversion
2018-08-07 15:47:02 -07:00
Olaoluwa Osuntokun 33a5567a0f Merge pull request #1691 from wpaulino/sync-gopkg
build: sync Gopkg.lock with Gopkg.toml
2018-08-06 16:15:33 -07:00