Branch: refs/heads/master
Home: https://github.com/conformal/btcdb
Commit: d6c2492c7f5a6df1f5bc3ed0b2058fbc7bd6b37a
https://github.com/conformal/btcdb/commit/d6c2492c7f5a6df1f5bc3ed0b2058fbc7bd6b37a
Author: Dave Collins <[email protected]>
Date: 2014-01-19 (Sun, 19 Jan 2014)
Changed paths:
M db.go
M ldb/block.go
M memdb/memdb.go
Log Message:
-----------
Add FetchBlockHeightBySha/FetchBlockHeaderBySha.
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.