Commit Graph

204 Commits

Author SHA1 Message Date
Valentine Wallace
f4005175d8
chainntnfs/interface: add ChainConn interface
This allows notifiers to pass their chain backend into interface functions to retrieve information from the chain.
2018-08-10 01:08:57 -07:00
Valentine Wallace
d4cf271526
chainntnfs: track best block in btcd and bitcoind 2018-08-10 01:08:57 -07:00
Valentine Wallace
1ffc3bb82e
multi: update to latest RegisterBlockEpochNtfn interface 2018-08-10 01:08:57 -07:00
Valentine Wallace
71a81f59a9
chainntnfs: allow clients to pass in best block
Clients can optionally pass their best block known into RegisterBlockEpochNtfn. This enables the notifiers to catch up clients on blocks they may have missed.
2018-08-10 01:08:54 -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
Conner Fromknecht
1ded697e8d
multi: sort import paths with gofmt 2018-08-02 18:20:49 -07:00
Olaoluwa Osuntokun
b1a775b29e
chainntnfs/neutrinonotify: update async conf dispatch to use scripts 2018-07-31 21:29:04 -07:00
Olaoluwa Osuntokun
1a5b1d9792
chainntnfs: update interface tests to pass the prev script into RegisterSpendNtfn 2018-07-31 21:28:53 -07:00
Olaoluwa Osuntokun
f87b1a94c5
chainntnfs/neutrinonotify: update neutrino backend to use new API
In this commit, we update the neutrino backend for the ChainNotifier to
use the new API which requires that callers pass the outpoint along with
the pkScript to be notified of any spends.
2018-07-31 21:28:53 -07:00
Olaoluwa Osuntokun
6781b17056
chainntnfs: update bitcoind and btcd backends to match new spend ntfn API 2018-07-31 21:28:53 -07:00
Olaoluwa Osuntokun
7a0b7d2742
chainntnfs: update RegisterSpendNtfn to take the prev output script
In this commit, we update the RegisterSpendNtfn method to also take the
prev output script of the item that we're attempting to watch for. This
change is required due to the recent modifications in the neutrino
protocol (BIP 158 + 157). With the new protocol, we'll match on the
script, but then dispatch notifications based on the precise outpoint
that matches.
2018-07-31 21:28:52 -07:00
Olaoluwa Osuntokun
21847dc691
chainntnfs/neutrinonotify: update conf notifications to use pkScript
In this commit, we update the implementation of conf notifications for
neutrino to use the output script rather than the txid when matching
blocks for relevant items. The change itself is rather minor as we just
pass in the script, yet match based on the txid as normal when we go to
dispatch notifications.
2018-07-31 21:28:49 -07:00
Olaoluwa Osuntokun
e93149e576
chainntnfs/btcdnotify: update RegisterConfirmationsNtfn to take pkScript 2018-07-31 21:28:49 -07:00
Olaoluwa Osuntokun
f45e41afc1
chainntnfs/bitcoindnotify: update RegisterConfirmationsNtfn to take pkScript 2018-07-31 21:28:48 -07:00
Olaoluwa Osuntokun
6387c9e085 chainntnfs: update interface to use pkScript for conf notifications 2018-07-31 21:14:41 -07:00
Olaoluwa Osuntokun
0f98030186 chainntnfs: update RegisterConfirmationsNtfn to also pass in pkScript of output
In this commit, we prep for an upcoming final change to BIP 158. The
change results in the txid no longer being included in the regular
filter. As a result, neutrino will now need to match based on the output
script of the transaction that we wish to receive confirmation
notifications for.
2018-07-31 21:13:43 -07:00
Wilmer Paulino
8f5f3bcab2 chainntnfs/interface_test: remove code found within helper functions 2018-07-31 18:23:25 -07:00
Wilmer Paulino
65b6257e1e chainntnfs/bitcoindnotify: make historical spend rescans async 2018-07-31 18:23:25 -07:00
Wilmer Paulino
12816a910d chainntnfs: make historical confirmation rescans async 2018-07-31 18:23:25 -07:00
Wilmer Paulino
867d8524bf chainntnfs/txconfnotifier: make confirmation notifcation registration async
In this commit, we modify our TxConfNotifier struct to allow handling
notification registrations asynchronously. The Register method has been
refactored into two: Register and UpdateConfDetails. In the case that a
transaction we registered for notifications on has already confirmed,
we'll need to determine its confirmation details on our own. Once done,
this can be provided within UpdateConfDetails.

This change will pave down the road for our different chain notifiers to
handle potentially long rescans asynchronously to prevent blocking the
caller.
2018-07-31 18:23:25 -07:00
Wilmer Paulino
c43506dee9 chainntnfs: add unique ID field to track conf ntfns within notifier 2018-07-31 18:23:25 -07:00
Wilmer Paulino
ad904ebe8c chainntnfs/txconfnotifier: use concrete ErrTxConfNotifierExiting error 2018-07-31 18:23:25 -07:00
Johan T. Halseth
181014c363
chainntnfs/bitcoindnotify: remove all mempool spend clients 2018-07-22 23:09:09 +02:00
Johan T. Halseth
3808105dcd
chainntnfs/btcdnotify: remove all mempool spend clients 2018-07-22 23:09:08 +02:00
Johan T. Halseth
02f7f29b97
chainntnfs/interface_test: remove mempool spend tests 2018-07-22 23:09:08 +02:00
Johan T. Halseth
44d7b84df0
chainntnfs: remove mempool option from RegisterSpendNtfn 2018-07-22 23:09:08 +02:00
Olaoluwa Osuntokun
274687471a
chainntnfs/btcdnotify: switch to async rescan call for historical spend ntfns
In this commit, we modify the way to handle historical spend dispatches
to ensure that we don't block the client for very old rescans. Rather
than blocking and waiting for the rescan to finish (which may take
minutes in the worst case), we'll now instead launch a goroutine to
handle the async response of the rescan.
2018-07-18 01:31:49 -07:00
Johan T. Halseth
07618ca0c6
chainntnfs/interface_test: increase wait time for mempool spends
This commit increases the time we wait for a spend client to notify a
mempool spend from 50ms to 10s. This is done to catch the case where
bitcoind would use up to 7 seconds before notifying about a mempool
spend, which wasn't caught by the test.
2018-07-16 15:08:59 +02:00
Johan T. Halseth
4e47e4e7f1
chainntnfs/bitcoindnotify: filter out mempool spends from relevant txs
This commit fix a bug within the bitcoind notifier logic, which would
ignore the passed mempool argument, and notify spentness whether the
spending transaction was confirmed or not. The logic used to fix this is
similar to what is already done for the btcd backend.
2018-07-16 12:27:05 +02:00
Olaoluwa Osuntokun
80ff2c8d9f
lnwallet+chainntnfs: update neutrino API usage due to recent changes 2018-07-13 17:15:12 -07:00
Olaoluwa Osuntokun
6f60f139f4 multi: switch over import paths from roasbeef/* to btcsuite/* 2018-07-13 17:05:39 -07:00
valentinewallace
8fcd6b56cb chainntnfs: expand test for mempool spend notifications
Make sure new clients get notified about txs that are already in the mempool.

Fixes #1074.
2018-05-01 19:09:56 -07:00
Olaoluwa Osuntokun
005510b54f
chainntnfs/bitcoindnotify: fix possible panic with lack of txindex
In this commit, we fix a recently introduced bug which can result in a
panic when bitcoind nodes without a txindex active are started. The
issue was that we would still defence the transaction's blockhash, which
would be nil if we detected that the backend didn't have the txindex
active.
2018-04-17 20:08:58 -07:00
practicalswift
663c396235 multi: fix a-vs-an typos 2018-04-17 19:02:04 -07:00
Wilmer Paulino
13fb866574
chainntnfs: remove txindex requirement when registering notfications
Before this commit, we relied on the need of full nodes to enable the
transaction index. This allowed us to fetch historical details about
transactions in order to register and dispatch confirmation and spend
notifications.

This commit allows us to drop that requirement by providing a fallback
method to use when the transaction index is not enabled. This fallback
method relies on manually scanning blocks for the transactions
requested, starting from the earliest height the transactions could have
been included in, to the current height in the chain.
2018-04-17 14:59:51 -04:00
Johan T. Halseth
53ec1c6fd2
chainntnfs test: Test historical dispatch for mempool and non-mempool clients
This commit extends the test to exercise a scanario that wasn't properly
covered, by registering for a confirmed spend notification for a
historical spend. We also extend the test to make sure it handles buried
spends properly.
2018-04-16 20:09:17 +02:00
Johan T. Halseth
5d6dd90d18
chainntnfs/btcdnotify: correctly notify on confirmed rescan spends
This commit fixes a recently introduced bug in the btcdnotifier, where
we would skip all spend clients waiting for a confirmed spend in
txUpdates. The regular case where a spend is included in a new block was
correctly handled in onBlockConnected, but the txUpdates queue is also
used for confirmed spends during rescans, which we would miss. This
commit fixes that by checking if the tx update is confirmed or
unconfirmed, and acts accordingly.
2018-04-16 20:09:08 +02:00
Olaoluwa Osuntokun
86ad6d318e
Merge pull request #889 from wpaulino/chainnotifier-updates
chainntnfs: add incremental update notifications within ChainNotifier
2018-04-12 19:21:26 -07:00
Alex
89e2ba41c9 chainntnfs/bitcoindnotify: rescan blocks manually instead of rewinding 2018-04-06 20:35:27 -06:00
Wilmer Paulino
19a2bd9c7d
chainntnfs: send incremental update notifications for tx confirmations
In this commit, we introduce the ability for the different ChainNotifier
implements to send incremental updates to the subscribers of transaction
confirmations. These incremental updates represent how many
confirmations are left for the transaction to be confirmed. They are
sent to the subscriber at every new height of the chain.
2018-04-06 00:30:25 -04:00
Wilmer Paulino
09f8a72897
chainntnfs: modify watched transactions by height to use a set
In this commit, we avoid storing extra copies of a transaction when
multiple clients register to be notified for the same transaction. We do
this by using a set, which only stores unique elements.
2018-04-06 00:30:23 -04:00
Wilmer Paulino
486694a84e
chainntnfs: add Updates channel field to ConfirmationEvent
In this commit, we add a new Updates channel to our ConfirmationEvent
struct. This channel will be used to deliver updates to a subscriber of
a confirmation notification. Updates will be delivered at every
incremental height of the chain with the number of confirmations
remaining for the transaction to be considered confirmed by the
subscriber.
2018-04-06 00:30:19 -04:00
Johan T. Halseth
6b6a616b1e
chainntfnfs test: add testSpendNotificationMempoolSpends for btcd backend
The test is only run for the btcd backend for now, as notifying on
mempool spends doesn't work for neutrino and bitcoind.
2018-04-03 11:24:08 +02:00
Johan T. Halseth
a36683e5e0
chainntfnfs test: check spend notification only on confirmation
This commit changes the chainntnfs tests to adhere to the new
RegisterSpendNtfn signature. It also makes sure that for the test
testSpendNotification, we are only getting notified when a spend is
mined, as previously btcd would notify on mempool inclusion, while
neutrino and bitcoind would notify only on confirmation, and the test
wouldn't catch this.
2018-04-03 11:24:07 +02:00
Johan T. Halseth
9e7e023194
chainntnfs/bitcoind: add bool to RegisterSpendNtfn 2018-04-03 11:24:07 +02:00
Johan T. Halseth
5283b6d210
chainntnfs/neutrino: add bool to RegisterSpendNtfn 2018-04-03 11:24:07 +02:00
Johan T. Halseth
cc17bc1636
chainntnfs/btcd: add logic for mempool argument to RegisterSpendNtfn
This commit adds a boolean to RegisterSpendNtfn, giving the caller the
option to only register for notifications on confirmed spends. This is
implemented for the btcd backend using logic similar to what is in used
for Neutrino, paving the way for later unifying them.
2018-04-03 11:24:07 +02:00
Johan T. Halseth
fa29adf9a3
chainntnfs interface: add mempool argument to RegisterSpendNtfn 2018-04-03 11:24:07 +02:00
Olaoluwa Osuntokun
47a1d3f9e5
Merge pull request #955 from halseth/neutrinonotify-epoch-queue
[small] neutrinonotify: use epochqueue to notify block epochs
2018-04-02 16:23:14 -07:00
Johan T. Halseth
13be19c9ec
chainntnfs/bitcoind: move NotifySpent to after recording the outpoint
This commit moves the call to the bitcoind backend to start watching an
outpoint for spentness to after we have recorded the outpoint in our
list of clients. This is done to avoid a race that we saw using the btcd
backend, and it is probable that it can also happen using bitcoind.
2018-03-28 10:22:41 +02:00
Johan T. Halseth
b08fc05390
chainntnfs/btcd: move NotifySpent to after recording the outpoint
This commit moves the call to the btcd backend to start watching an
outpoint for spentness to after we have recorded the outpoint in our
list of clients. This is done to avoid a race that could occur if btcd
quicly sent a spend notification before we had been able to record it in
our map, essentially losing it.
2018-03-28 10:21:08 +02:00
Johan T. Halseth
891fb20622
neutrinonotify: use epochqueue to notify block epochs 2018-03-28 08:13:10 +02:00
Olaoluwa Osuntokun
a9dc4f80f2
chainntnfs/neutrinonotify: log height hint for spend notifications 2018-03-01 16:49:28 -08:00
Olaoluwa Osuntokun
2a61ccec96
chainntnfs: fix new golang 1.10 vet/test warning 2018-02-19 18:06:35 -08:00
Olaoluwa Osuntokun
9c18c3d9a4
chainntnfs: ensure all block epoch notifications are sent *in order*
In this commit, we fix a lingering bug related to the way that we
deliver block epoch notifications to end users. Before this commit, we
would launch a new goroutine for *each block*. This was done in order
to ensure that the notification dispatch wouldn’t block the main
goroutine that was dispatching the notifications. This method archived
the goal, but had a nasty side effect that the goroutines could be
re-ordered during scheduling, meaning that in the case of fast
successive blocks, then notifications would be delivered out of order.
Receiving out of order notifications is either disallowed, or can cause
sub-systems that rely on these notifications to get into weird states.

In order to fix this issue, we’ll no longer launch a new goroutine to
deliver each notification to an awaiting client. Instead, each client
will now gain a concurrent in-order queue for notification delivery.
Due to the internal design of chainntnfs.ConcurrentQueue, the caller
should never block, yet the receivers will receive notifications in
order. This change solves the re-ordering issue and also minimizes the
number of goroutines that we’ll create in order to deliver block epoch
notifications.
2018-02-09 16:13:28 -08:00
practicalswift
a93736d21e multi: comprehensive typo fixes across all packages 2018-02-06 19:11:11 -08:00
Olaoluwa Osuntokun
ddf4715e3c
chainntnfs/neutrinonotify: fix regression for historical spend dispatches
In this commit, we fix an issue that was recently introduced to the way
we handle historical dispatches for the neutrino notifier. In a recent
change, we no return an error if we’re unable to actually find the
transaction that spends an outpoint. If this is the case, then the
outpoint is actually unspent, and we should proceed as normal.
2018-02-02 17:59:16 -08:00
Olaoluwa Osuntokun
bf6001074c
chainntnfs: fix spend notification registration race condition
In this commit, we fix a race condition related to the way we attempt
to query to see if an outpoint has already been spent by the time it’s
registered within the ChainNotifier. If the transaction creating the
outpoint hasn’t made it into the mempool by the time we execute the
GetTxOut call, then we’ll attempt to query for the transaction itself.
In this case, if we query for the transaction, then the block hash
field will be empty as it hasn’t yet made it into a block. Under the
previous logic, we’d then attempt to force a rescan. This is an issue
as the forced rescan will fail since it’ll try to fetch the block hash
of all zeroes.

In this commit, we fix this issue by only entering this “fallback to
rescan” logic iff, the transaction has actually been mined.
2018-01-28 14:48:56 -08:00
Alex
db55569bac chainntfns: stop neutrino service before closing DB in interface_test.go 2018-01-15 13:59:34 -08:00
Alex
187f59556a multi: add bitcoind drivers and tests 2018-01-15 13:59:34 -08:00
Matt Drollette
adf0d98194 multi: fix several typos in godoc comments 2017-12-17 18:40:05 -08:00
Jim Posen
bc7c834362 chainntnfs: Fix stylistic issues. 2017-12-14 19:16:15 -08:00
Jim Posen
280e264e8c chainntnfs: Implement quit signal in TxConfNotifier. 2017-12-14 19:16:15 -08:00
Jim Posen
2639b58e4b chainntnfs: Send negative confirmation notifications. 2017-12-14 19:16:15 -08:00
Jim Posen
c5320f2731 chainntnfs: Test that neutrino rescan plays nice with txConfNotifier. 2017-12-14 19:16:15 -08:00
Jim Posen
abf3685d2d chainntnfs/neutrino: Refactor NeutrinoNotifier to use TxConfNotifier. 2017-12-14 19:16:15 -08:00
Jim Posen
4405dac4d0 chainntnfs/btcd: Refactor BtcdNotifier to use TxConfNotifier. 2017-12-14 19:16:15 -08:00
Jim Posen
122cf3b960 chainntnfs: Unit tests for TxConfNotifier.
Also fix overflow issue with reorg handling.
2017-12-14 19:16:15 -08:00
Jim Posen
d2a9dcf855 chainntnfs: TxConfNotifier struct to implement shared notifer logic.
All implementations of the ChainNotifier interface support registering
notifications on transaction confirmations. This struct is intended to
be used internally by ChainNotifier implementations to handle much of
this logic.
2017-12-14 19:16:15 -08:00
Jim Posen
fa513a76ad chainntnfs/neutrino: Handle block connects and disconnects in order. 2017-12-14 19:16:15 -08:00
Jim Posen
0cac7e80d4 chainntnfs/btcd: Handle block disconnects with chainUpdate.
This does not implement full handling of block disconnections, but
ensures that all chain updates are processed in order.
2017-12-14 19:16:15 -08:00
Jim Posen
28c6a988ca chainntnfs: Test that chain notifiers handle chain reorgs correctly.
Tests are failing for both btcd and neutrino notifiers.
2017-12-14 19:16:15 -08:00
Olaoluwa Osuntokun
839ce0689e
chainntnfs/btcdnotify: add additional logic when dispatching ntfns 2017-12-07 19:09:53 -08:00
Olaoluwa Osuntokun
36c299c1d8
chainntnfs/neutrinonotify: fix early historical confirmation dispatch
In this commit, we fix an existing bug within the logic of the neutrino
notifier. Rather than properly dispatching only once a transaction had
reached the expected number of confirmations, the historical dispatch
logic would trigger as soon as the transaction reached a single
confirmation.

This was due to the fact that we were using the scanHeight variable
which would be set to zero to calculate the number of confirmations.
The value would end up being the current height, which is generally
always greater than the number of expected confirmations. To remedy
this, we’ll now properly use the block height the transaction was
originally confirmed in to know when to dispatch.

This also applies a fix that was discovered in
93981a85c0b47622a3a5e7089b8bca9b80b834c5.
2017-12-07 19:08:48 -08:00
Olaoluwa Osuntokun
d329502e8d
chainntnfs: expand historical dispatch test case to detect early dispatches
In this commit, we extend the existing historical dispatch test case to
detect any instances of early dispatches. This catches a class of bug
within a ChainNotifier when the notifier will *always* dispatch early
no matter the number of confirmations. Currently, this test fails for
the neutrino notifier.
2017-12-07 19:05:40 -08:00
Jim Posen
0297042a8d chainntnfs: Use the new ConcurrentQueue in btcd notifier. 2017-11-16 15:15:22 -08:00
Jim Posen
c9ad9b2269 chainntnfs: Use the new ConcurrentQueue in neutrino notifier. 2017-11-16 15:15:22 -08:00
Jim Posen
726c8b2301 chainntnfs: Implement unbounded concurrent-safe FIFO queue.
This can be used in at least one place in the notifiers to improve
efficiency and reduce complexity.
2017-11-16 15:15:22 -08:00
Sam Lewis
1f95b660b9 chainntfns: Fix off by 1 block height error
In the historical dispatch of btcdnotify, the dispatcher checks if a
transaction has been included in a block. If this check happens before
the notifier has processed the update, it's possible that the
currentHeight of the notifier and the currentHeight of the chain might
be out of sync which causes an off by one error when calculating a
target height for the transaction confirmation. This change uses the
height of the block the transaction was found in, rather than the
currentHeight that's known by the notifier to eliminate this.
2017-11-13 22:36:25 -08:00
Sam Lewis
93981a85c0 chainntnfs: Fix btcdnotify dispatch race condition
This race condition can occur if a transaction is included in a block
right when a notification is being added to the notifier for it AND when
the confirmation requires > 1 confirmations. In this case, the
confirmation gets added to the confirmation heap twice.
2017-11-13 22:36:25 -08:00
Sam Lewis
b3509d491a chainntnfs: Add chainntfs lazy consumer test
This test adds a test for a consumer that registers for a transaction
confirmation but takes some time to check if that confirmation has
occured.

The test reveals a race condition that can cause btcdnotify to add a
confirmation entry to its internal heap twice. If the notification
consumer is not prompt in reading from the confirmation channel, this
can cause the notifier to block indefinitely.
2017-11-13 22:36:25 -08:00
Alex
50d88e7769 chainntfns/neutrinonotify: update driver to comply with BIP 2017-11-02 20:04:07 -07:00
Jim Posen
e9c16845dc chainntnfs: Remove some unnecessary channels in interface_test. 2017-10-19 20:00:16 -07:00
Jim Posen
be7cb08f41 chainntnfs: Rename file with typo in filename. 2017-10-19 20:00:16 -07:00
Olaoluwa Osuntokun
e5f3ee0fb6
chainntnfs+routing/chainview: reduce neutrino.WaitForMoreCFHeaders value
This commit reduces the neutrino.WaitForMoreCFHeaders parameter when
instantiating a neutrino instance as a lower value will allow the tests
to complete more quickly.
2017-09-13 16:46:11 +02:00
Olaoluwa Osuntokun
5044cd6468
chainntnfs/btcdnotify: recognize JSON-RPC error in RegisterSpendNtfn
This commit fixes a prior bug in the logic for registering a new spend
notification. Previously, if the transaction wasn’t found in the
mempool or already confirmed within the chain, then
GetRawTransactionVerbose would return an error which would cause the
function itself to exit with an error.

This issue would then cause the server to be unable to start up as the
breach arbiter would be unable to register for spend notifications for
all the channels that it needed to be watching.

We fix this error simply by recognizing the particular JSON-RPC error
that will be returned in this scenario and treating it as a benign
error.
2017-09-12 17:11:47 +02:00
Olaoluwa Osuntokun
ed7eae819a
chainntnfs/btcdnotify: don't error if tx not found for historical conf dispatch
This commit fixes a prior mishandled error when attempting historical
confirmation dispatches. In the prior version of this code fragment, if
the transaction under the spotlight wasn’t found within the mempool, or
already in the chain, then an error would be returned by
b.chainConn.GetRawTransactionVerbose, which would case the function to
exit with an error. This behavior was incorrect, as during transaction
re-broadcasts, it was possible for transaction not yet to be a member
of either set.

We fix this issue by ensuring that we treat the JSON error code as a
benign error and continue with the notification registration.
2017-09-12 17:06:58 +02:00
Philip Hayes
f0aa186a56 channeldb+utxonursery+lnwire: use lnwire's OutPoint,TxOut serialization 2017-08-25 17:56:50 -07:00
Olaoluwa Osuntokun
9f0efddc20
multi: switch from btcrpcclient to rpcclient 2017-08-24 18:54:24 -07:00
Olaoluwa Osuntokun
671f15383b
chainntnfs: fix a typo 2017-08-10 21:15:38 -07:00
Conner Fromknecht
d1e797451d chainntnfs/btcd+neutrino: close spendChan after send 2017-08-03 17:32:44 -07:00
Olaoluwa Osuntokun
399d9c974f
chainntnfs: ensure ntfn cancellation loop will exit
This commit fixes a slight bug introduced. We now ensure that the
cancel loop always exists if the ChainNotifier has been signaled for a
quit.
2017-08-01 17:14:11 -07:00
Conner Fromknecht
9f85eadde1 chainntnfs/btcd+neutrino: sync epoch cancel 2017-07-31 21:44:23 -07:00
Conner Fromknecht
a9b1af4c73 chainntnfs/btcd+neurtino: unify + sync ntfn cancels 2017-07-31 21:44:23 -07:00
Olaoluwa Osuntokun
c47047c0b8
chainntnfs: extend interface test to ensure initial conf height is correct 2017-07-11 17:38:43 -07:00
Olaoluwa Osuntokun
c5f4049394
chainntnfs: convert ChainNotifier interface tests to use sub-tests 2017-07-04 15:54:45 -07:00
Andrey Samokhvalov
8fa2b95c12 lnd: remove seelog logger
The btclog package has been changed to defining its own logging
interface (rather than seelog's) and provides a default implementation
for callers to use.

There are two primary advantages to the new logger implementation.

First, all log messages are created before the call returns.  Compared
to seelog, this prevents data races when mutable variables are logged.

Second, the new logger does not implement any kind of artifical rate
limiting (what seelog refers to as "adaptive logging").  Log messages
are outputted as soon as possible and the application will appear to
perform much better when watching standard output.

Because log rotation is not a feature of the btclog logging
implementation, it is handled by the main package by importing a file
rotation package that provides an io.Reader interface for creating
output to a rotating file output.  The rotator has been configured
with the same defaults that btcd previously used in the seelog config
(10MB file limits with maximum of 3 rolls) but now compresses newly
created roll files.  Due to the high compressibility of log text, the
compressed files typically reduce to around 15-30% of the original
10MB file.
2017-06-25 14:19:56 +01:00
Olaoluwa Osuntokun
54cb8a05cd
chainntnfs: fix vet error, don't pass lock by value 2017-06-07 17:07:33 -07:00
Olaoluwa Osuntokun
baf769eaf0
chainntnfs/neutrinonotify: fix deadlock when notifying blocks, wait for epoch coroutines to exit 2017-06-07 17:05:22 -07:00
Olaoluwa Osuntokun
625d57aea6
chainntnfs/btcdnotify: ensure block epoch coroutines exit before closing ntfn channel 2017-06-07 17:04:32 -07:00