lbcd/blockchain/indexers
Dave Collins 20910511e9
blockchain: Refactor to use new chain view.
- Remove inMainChain from block nodes since that can now be efficiently
  determined by using the chain view
- Track the best chain via a chain view instead of a single block node
  - Use the tip of the best chain view everywhere bestNode was used
  - Update chain view tip instead of updating best node
- Change reorg logic to use more efficient chain view fork finding logic
- Change block locator code over to use more efficient chain view logic
  - Remove now unused block-index-based block locator code
  - Move BlockLocator definition to chain.go
  - Move BlockLocatorFromHash and LatestBlockLocator to chain.go
    - Update both to use more efficient chain view logic
- Rework IsCheckpointCandidate to use block index and chain view
- Optimize MainChainHasBlock to use chain view instead of hitting db
  - Move to chain.go since it no longer involves database I/O
  - Removed error return since it can no longer fail
- Optimize BlockHeightByHash to use chain view instead of hitting db
  - Move to chain.go since it no longer involves database I/O
  - Removed error return since it can no longer fail
- Optimize BlockHashByHeight to use chain view instead of hitting db
  - Move to chain.go since it no longer involves database I/O
  - Removed error return since it can no longer fail
- Optimize HeightRange to use chain view instead of hitting db
  - Move to chain.go since it no longer involves database I/O
- Optimize BlockByHeight to use chain view for main chain check
- Optimize BlockByHash to use chain view for main chain check
2017-08-23 23:43:37 -05:00
..
addrindex.go blockchain/indexers: add addrindex support for p2wkh and p2wsh 2017-08-13 23:17:40 -05:00
addrindex_test.go multi: Correct misspellings detected by misspell. 2016-10-28 09:43:38 -05:00
blocklogger.go indexers: Implement optional tx/address indexes. 2016-04-11 17:16:42 -05:00
common.go database: Replace with new version. 2016-04-12 14:55:15 -05:00
log.go indexers: Implement optional tx/address indexes. 2016-04-11 17:16:42 -05:00
manager.go blockchain: Refactor to use new chain view. 2017-08-23 23:43:37 -05:00
README.md multi: Update markdown files for GFM changes. 2017-05-25 12:06:16 -05:00
txindex.go chainhash: Abstract hash logic to new package. (#729) 2016-08-08 14:04:33 -05:00

indexers

Build Status ISC License GoDoc

Package indexers implements optional block chain indexes.

These indexes are typically used to enhance the amount of information available via an RPC interface.

Supported Indexers

  • Transaction-by-hash (txbyhashidx) Index
    • Creates a mapping from the hash of each transaction to the block that contains it along with its offset and length within the serialized block
  • Transaction-by-address (txbyaddridx) Index
    • Creates a mapping from every address to all transactions which either credit or debit the address
    • Requires the transaction-by-hash index

Installation

$ go get -u github.com/btcsuite/btcd/blockchain/indexers

License

Package indexers is licensed under the copyfree ISC License.