Documentation ¶
Overview ¶
This file is part of the go-ethereum library.
The go-ethereum library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
The go-ethereum library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
Index ¶
- Variables
- func NewPool(server string) *redis.Pool
- type BlockChain
- func (b *BlockChain) CurrentHeader() *types.Header
- func (b *BlockChain) GetHeaderByHash(hash common.Hash) *types.Header
- func (b *BlockChain) GetTd(hash common.Hash, number uint64) *big.Int
- func (b *BlockChain) HasHeader(desiredHash common.Hash, desiredHashNumber uint64) bool
- func (b *BlockChain) InsertHeaderChain(headers []*types.Header, checkFreq int) (int, error)
Constants ¶
This section is empty.
Variables ¶
var (
Pool *redis.Pool
)
Functions ¶
Types ¶
type BlockChain ¶
type BlockChain struct {
// contains filtered or unexported fields
}
Blockchain is an interface to be used by the devp2p downloader to abstract the Redis DB
func LoadBlockChain ¶
func LoadBlockChain(dbPool *redis.Pool) *BlockChain
func (*BlockChain) CurrentHeader ¶
func (b *BlockChain) CurrentHeader() *types.Header
CurrentHeader retrieves the head header from the local chain.
func (*BlockChain) GetHeaderByHash ¶
func (b *BlockChain) GetHeaderByHash(hash common.Hash) *types.Header
GetHeaderByHash retrieves a header from the local chain.
func (*BlockChain) HasHeader ¶
func (b *BlockChain) HasHeader(desiredHash common.Hash, desiredHashNumber uint64) bool
HasHeader verifies a header's presence in the local chain (i.e. CHT)
func (*BlockChain) InsertHeaderChain ¶
InsertHeaderChain inserts a batch of headers into the local chain.