Commit graph

99 commits

Author SHA1 Message Date
Olaoluwa Osuntokun
0059b9fcd9
Merge pull request #537 from cfromknecht/dont-print-rawtx-garbage
chain/bitcoind_conn: only print ASCII rawtx event types
2018-09-03 17:55:49 -07:00
Conner Fromknecht
042d409236
chain/bitcoind_conn: only print ASCII rawtx event types 2018-08-31 16:31:29 -07:00
Wilmer Paulino
d179c276b4
chain/rpc: remove unnecessary ping keep alive
In this commit, we remove the keep-alive logic within the handler of the
RPCClient struct as this logic already exists within the backing
rpclient.Client instance. In this case, we'd completely stop the
connection after the ping timeout (1 min), which would render the
reconnection logic within rpcclient.Client useless.
2018-08-27 17:25:16 -07:00
Olaoluwa Osuntokun
caab9f91f0
chain: update neutrino client due to recent API changes 2018-08-22 20:20:31 -07:00
Wilmer Paulino
850ad0959a
chain: ensure eventType from ZMQ response is human-readable
In this commit, we fix a small issue where it's possible that we read a
malformed message from the ZMQ connection to bitcoind due to it shutting
down. To fix this, we ensure that the event type is human readable
before attempting to log it.
2018-08-15 18:17:29 -07:00
Wilmer Paulino
d6155a55e9
chain: improve error when filtering blocks and transactions 2018-08-15 17:37:04 -07:00
Wilmer Paulino
5f7060dadf
chain: handle ZMQ timeout error correctly 2018-08-15 17:37:03 -07:00
Wilmer Paulino
8357e86a4d chain: match transaction against currently watched transactions
In this commit, we extend the client's filtering process to also look at
the set of currently watched transactions. The logic to watch for
transaction hashes was previously there, but it was not used to filter
against incoming transactions.
2018-07-30 17:54:08 -07:00
Wilmer Paulino
00428d5828 chain: share the same bitcoind connection between multiple rescan clients 2018-07-30 17:54:08 -07:00
Wilmer Paulino
27e22b1f79 chain: return err when updating the rescan filter while shutting down 2018-07-30 14:55:56 -07:00
Wilmer Paulino
0b269d799e
chain: send empty struct instance rather than bool to reset filters 2018-07-26 16:38:58 -07:00
Wilmer Paulino
7df2b72beb
chain: switch BitcoindClient to use atomic started/stopped pattern 2018-07-26 16:38:57 -07:00
Wilmer Paulino
1aeead0eeb
chain: keep track of the best block within BitcoindClient
In the previous commit, we modified our BitcoindClient struct to use a
ConcurrentQueue struct to handle its notifications to the caller. Before
this, the BitcoindClient had a goroutine that would handle these
notifications in the background and detect when a OnBlockConnected
notification was received in order to update the best block. Due to this
logic being removed, we now keep track of the best block througout the
struct as a whole.
2018-07-26 16:38:56 -07:00
Wilmer Paulino
2091ac0936
chain: use ConcurrentQueue within BitcoindClient to handle event notifications 2018-07-26 16:38:55 -07:00
Wilmer Paulino
fc73cc9678
chain: add concurrent unbounded queue implementation 2018-07-26 16:38:54 -07:00
Wilmer Paulino
8e9e4d6926
chain: rename bitcoind.go to bitcoind_client.go 2018-07-26 16:38:38 -07:00
Olaoluwa Osuntokun
5b3d124de2 chain: also accept map[wire.OutPoint]btcutil.Address for bitcoind rescans
In this commit, we update bitcoind to also accept a mapping from
outpoint to address for its implementation of the recan RPC. We do this
as in the near future, when bitcoind implements BIP 158 indexing, then
we'll be able to utilize that to do rescans.
2018-07-17 19:05:17 -07:00
Olaoluwa Osuntokun
6a0e6da280 chain: continue to accept []wire.OutPoint for rescan updates for bitcoind
In this commit, we fix a recently introduced bug that would cause
callers that attempted to get a spend notifications for a particular
outpoint to no longer get that precise notification. In a prior commit,
in preparation for the new neutrino gcs filter format, we added a
mapping from script to outpoint that will be used by neutrino, and later
other backends as well. However, we still need to match on outpoint
slices for bitcoind today.
2018-07-17 19:05:17 -07:00
Olaoluwa Osuntokun
fdca047246 chain: update block filterer unit tests 2018-07-16 19:47:17 -07:00
Olaoluwa Osuntokun
b29e917a24 chain: update Rescan method for bitcoind to adhere to new interface 2018-07-16 19:47:17 -07:00
Olaoluwa Osuntokun
bc47007c50 chain: update block filterer to map outpoints to addrs 2018-07-16 19:47:17 -07:00
Olaoluwa Osuntokun
714ac383cb chain: update watched/found outpoints to map to addrs 2018-07-16 19:47:17 -07:00
Olaoluwa Osuntokun
2d600fe6ab chain: create new Rescan wrapper for btcd to comply w/ future BIP 158 usage 2018-07-16 19:47:17 -07:00
Olaoluwa Osuntokun
b24714270a chain: update neutrino interface impl to use new InputWithScript 2018-07-16 19:47:17 -07:00
Olaoluwa Osuntokun
87d91316cd chain: update interface to map outpoints to their addresses
In this commit, we update the Rescan call in the interface to map the
outpoint to the address that the outpoint holds. We do this as BIP 158
has recently been updated to match on the prev output script rather than
the outpoint itself. Additionally, in the near future, btcd (then
bitcoind), will switch over to using the BIP 158 filters internally,
which will also match on the output scripts.
2018-07-16 19:47:17 -07:00
Olaoluwa Osuntokun
64b5b448f5 chain: update neutrino API usage 2018-07-13 16:53:17 -07:00
Olaoluwa Osuntokun
e9b145c524 multi: run goimports 2018-05-23 19:38:56 -07:00
Olaoluwa Osuntokun
7770cac383 multi: switch import paths back to upstream 2018-05-23 19:38:56 -07:00
Conner Fromknecht
549eca51de chain/block_filterer_test: adds test for 1-in-1-out txns 2018-05-23 19:38:56 -07:00
Conner Fromknecht
9437c3784a chain/rpc: impl FilterBlocks using gc filter rescan 2018-05-23 19:38:56 -07:00
Conner Fromknecht
9b0831cd65 chain/neutrino: impl FilterBlocks via filters + rescan 2018-05-23 19:38:56 -07:00
Conner Fromknecht
5278cd3de8 chain/interface: add FilterBlocks query 2018-05-23 19:38:56 -07:00
Conner Fromknecht
2ff809fd78 chain/block_filterer: adds BlockFilterer for scanning during recovery 2018-05-23 19:38:56 -07:00
Conner Fromknecht
93d73bf06c chain/bitcoind: impl FilterBlocks via rescan 2018-05-23 19:38:56 -07:00
Alex
3f15a85da7 chain: ensure bitcoind back-end fully rescans and sends correct ntfn 2018-05-23 19:38:56 -07:00
Alex
81c4b1d096 chain: eliminate start of sync race condition in bitcoind back-end
This commit also allows bitcoind back-end to return block timestamp
in `BlockStamp()` and prevents logging and notification of events
until after the client wallet requests notifications.
2018-05-23 19:38:56 -07:00
Alex
6b6ed89d87 chain: improve reorg-during-rescan handling for bitcoind 2018-05-23 19:38:56 -07:00
Conner Fromknecht
2bd4130581 chain/bitcoind: connect to zmq in Start() to return error 2018-05-23 19:38:56 -07:00
Alex
30d84da3e5 build+chain: replace pebbe/zmq4 with lightninglabs/gozmq (native Go) 2018-05-23 19:38:56 -07:00
Alex
a16bfd7775 chain/neutrino: fix data races due to not using pointer for rescan 2018-05-23 19:38:56 -07:00
Alex
78a69b4802 chain/neutrino: fix deadlock 2018-05-23 19:38:56 -07:00
Alex
73dbcf3943 multi: add bitcoind back-end (only for API use for now) 2018-05-23 19:38:56 -07:00
Alex
d7ad221ee0 chain: ensure clientMtx is never locked while waiting on channel 2018-05-23 19:38:56 -07:00
Alex
1b6d7a7ee3 chain: add GetBlockHeader support
This commit allows neutrino to simulate the GetBlockHeader RPC, and
allows chain client code to use the call with both btcd/RPC back end
and the neutrino back end.
2018-05-23 19:38:56 -07:00
Alex
e06434ed75 chain: add StartTime support to neutrino client
This commit adds support for using StartTime in a rescan in
neutrino. The NeutrinoClient instance can have a birthday set
such that all underlying neutrino rescans are called with that
start time.
2018-05-23 19:38:56 -07:00
Olaoluwa Osuntokun
a0abd3632c multi: update to new upstream btcsuite/btcd API's 2018-05-23 19:38:56 -07:00
Alex
081f7b0dce chain: fix issue where mutex can be unlocked twice 2018-05-23 19:38:56 -07:00
Alex Akselrod
c85893de1a chain+waddrmgr+wallet: store all hashes for better reorg handling (#5) 2018-05-23 19:38:56 -07:00
Olaoluwa Osuntokun
4ac75773d7 chain: wait for rescan exit before re-creating, ensure thread safety 2018-05-23 19:38:56 -07:00
Olaoluwa Osuntokun
3dc7a8529c multi: switch all imports to roasbeef's forks 2018-05-23 19:38:56 -07:00