Commit graph

83 commits

Author SHA1 Message Date
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
Olaoluwa Osuntokun
7acc49dddb chain: also register blockConnected for NotigyReceived calls 2018-05-23 19:38:56 -07:00
Olaoluwa Osuntokun
772fbd4726 chain: dispatch BlockConnected notifications for NeutrinoClient 2018-05-23 19:38:56 -07:00
Olaoluwa Osuntokun
dbe472edd6 build: update neutrino glide.lock hash, API usage 2018-05-23 19:38:56 -07:00
Alex
3f12fa3c6c chain+wallet: rename SPVChain to NeutrinoClient 2018-05-23 19:38:56 -07:00
Alex
4598742465 chain: stop SPV rescan immediately when wallet is already caught up 2018-05-23 19:38:56 -07:00
Alex
3601b2fa14 chain: fix RescanFinished notification 2018-05-23 19:38:56 -07:00
Alex
d6bcab4912 chain: make ChainService public member of SPVChain struct 2018-05-23 19:38:56 -07:00
Alex
0e7e8404e5 chain: fix Neutrino driver bugs 2018-05-23 19:38:56 -07:00
Alex
b5873a5b2c Finish integration of Neutrino; still untested. 2018-05-23 19:38:56 -07:00
Alex
9e5250e6d7 More neutrino integration into btcwallet. 2018-05-23 19:38:56 -07:00
Alex
3d81f856fd Move spvchain into neutrino and start integration w/btcwallet 2018-05-23 19:38:56 -07:00
Alex
32adc3c43f Make rescan a struct, add spending tx to GetUtxo, start integration. 2018-05-23 19:38:56 -07:00
Olaoluwa Osuntokun
521b2123de Fix RPC ping/pong deadlock and timeout issue.
This is a backport of decred/dcrwallet#612.

This change moves the wait for the session RPC response (used as a
pong) to a new goroutine that does not run directly in the queue
handler.  By moving this out to a new goroutine, the handler can
continue enqueuing and dequeueing notifications while waiting for the
session response.  Previously, if a notifiation was sent after the
session RPC was called and before the response was received, the
rpcclient main loop would block due to being unable to enqueue the
notification.
2018-05-23 19:38:56 -07:00
Olaoluwa Osuntokun
01d52770d2 chain: enable auto-reconnect within the client 2018-05-23 19:38:56 -07:00
Olaoluwa Osuntokun
77b756c651 multi: point all imports towards roasbeef's forks 2018-05-23 19:38:56 -07:00
Dave Collins
e92f94dcd1 Update for recent chainhash-related API changes. (#450)
This updates all code to make use of the new chainhash package since the
old wire.ShaHash type and related functions have been removed in favor
of the abstracted package.

Also, while here, rename all variables that included sha in their name
to include hash instead.

Finally, update glide.lock to use the required version of btcd, btcutil,
and btcrpcclient.
2016-08-08 14:49:09 -05:00