Some indexes require all of the previous output scripts referenced as inputs by the blocks they are indexing. Currently, the indexing code relies on a concrete blockchain.UtxoViewpoint to provide that information which makes the indexing code more rigid than it needs to be and prevents the possibility of using other sources, such as the spend journal, to provide the necessary scripts. In addition, the index initialization code also currently requires access to a concrete blockchain.BlockChain to query the current chain state which also makes the code more rigid than it should ideally be. Consequently, this modifies the indexing code to accept a PrevScripter interface to remove the tight coupling to a specific type in the former case, and introduces a new ChainQueryer interface to remove the tight coupling in the latter case. In order to fully remove the blockchain dependency from the indexers package, this also moves the IndexManager interface from blockchain to indexers and modifies it to use the new ChainQueryer interface in order to provide the necessary information. Finally, all code is updated to satisfy and use the interfaces. |
||
|---|---|---|
| .. | ||
| addblock | ||
| dcrctl | ||
| findcheckpoint | ||
| gencerts | ||
| promptsecret | ||