d6c2492c7f
This commit introduces two new functions to the btcdb.Db interface named FetchBlockHeightBySha and FetchBlockHeaderBySha. The FetchBlockHeightBySha function is useful since previously it was only possible to get the height of block by fetching the entire block with FetchBlockBySha and pulling the height out of the returned btcutil.Block. The FetchBlockHeaderBySha function will ultimately make it much more efficient to fetch block headers. Currently, due to the database design in the ldb backend, the entire block has to be loaded anyways, so the only current benefit is to avoid the deserialize on all of the transactions. However, ultimately btcdb will gain a more efficient backend which can also avoid reading all of the extra transaction data altogether. |
||
---|---|---|
.. | ||
dbtest | ||
block.go | ||
boundary_test.go | ||
dbcache.go | ||
doc.go | ||
dup_test.go | ||
insertremove_test.go | ||
internal_test.go | ||
leveldb.go | ||
operational_test.go | ||
tx.go |