Documentation ¶
Index ¶
- Constants
- func GetBestBlock(chainstateDb *ChainstateDb) ([]byte, error)
- func GetFlag(indexDb *IndexDb, name []byte) (bool, error)
- func GetLastBlockFileNumberUsed(indexDb *IndexDb) (uint32, error)
- func GetReindexing(indexDb *IndexDb) (bool, error)
- type BlockIndexRecord
- func GetBlockIndexRecord(indexDb *IndexDb, blockHash []byte) (*BlockIndexRecord, error)
- func GetBlockIndexRecordByBigEndianHex(indexDb *IndexDb, blockHash string) (*BlockIndexRecord, error)
- func GetBlockIndexRecordByHex(indexDb *IndexDb, blockHash string) (*BlockIndexRecord, error)
- func NewBlockIndexRecordFromBytes(b []byte) *BlockIndexRecord
- type ChainstateDb
- type DataBuf
- func (buf *DataBuf) Reset()
- func (buf *DataBuf) Seek(pos uint64)
- func (buf *DataBuf) Shift16bit() uint16
- func (buf *DataBuf) Shift32bit() int32
- func (buf *DataBuf) Shift64bit() int64
- func (buf *DataBuf) ShiftByte() byte
- func (buf *DataBuf) ShiftBytes(length uint64) []byte
- func (buf *DataBuf) ShiftU32bit() uint32
- func (buf *DataBuf) ShiftU64bit() uint64
- func (buf *DataBuf) ShiftVarint() uint64
- type FileInfoRecord
- type IndexDb
- type TxIndexRecord
- func GetTxIndexRecord(indexDb *IndexDb, txHash []byte) (*TxIndexRecord, error)
- func GetTxIndexRecordByBigEndianHex(indexDb *IndexDb, txHash string) (*TxIndexRecord, error)
- func GetTxIndexRecordByHex(indexDb *IndexDb, txHash string) (*TxIndexRecord, error)
- func NewTxIndexRecordFromBytes(b []byte) *TxIndexRecord
Constants ¶
View Source
const ( //! Unused. BLOCK_VALID_UNKNOWN = 0 //! Parsed, version ok, hash satisfies claimed PoW, 1 <= vtx count <= max, timestamp not in future BLOCK_VALID_HEADER = 1 //! All parent headers found, difficulty matches, timestamp >= median previous, checkpoint. Implies all parents //! are also at least TREE. BLOCK_VALID_TREE = 2 /** * Only first tx is coinbase, 2 <= coinbase input script length <= 100, transactions valid, no duplicate txids, * sigops, size, merkle root. Implies all parents are at least TREE but not necessarily TRANSACTIONS. When all * parent blocks also have TRANSACTIONS, CBlockIndex::nChainTx will be set. */ BLOCK_VALID_TRANSACTIONS = 3 //! Outputs do not overspend inputs, no double spends, coinbase output ok, no immature coinbase spends, BIP30. //! Implies all parents are also at least CHAIN. BLOCK_VALID_CHAIN = 4 //! Scripts & signatures ok. Implies all parents are also at least SCRIPTS. BLOCK_VALID_SCRIPTS = 5 //! All validity bits. BLOCK_VALID_MASK = BLOCK_VALID_HEADER | BLOCK_VALID_TREE | BLOCK_VALID_TRANSACTIONS | BLOCK_VALID_CHAIN | BLOCK_VALID_SCRIPTS BLOCK_HAVE_DATA = 8 //!< full block available in blk*.dat BLOCK_HAVE_UNDO = 16 //!< undo data available in rev*.dat BLOCK_HAVE_MASK = BLOCK_HAVE_DATA | BLOCK_HAVE_UNDO BLOCK_FAILED_VALID = 32 //!< stage after last reached validness failed BLOCK_FAILED_CHILD = 64 //!< descends from failed block BLOCK_FAILED_MASK = BLOCK_FAILED_VALID | BLOCK_FAILED_CHILD BLOCK_OPT_WITNESS = 128 //!< block data in blk*.data was received with a witness-enforcing client )
Variables ¶
This section is empty.
Functions ¶
func GetBestBlock ¶
func GetBestBlock(chainstateDb *ChainstateDb) ([]byte, error)
func GetReindexing ¶
Types ¶
type BlockIndexRecord ¶
type BlockIndexRecord struct { Version int32 Height int32 Status uint32 NTx uint32 NFile int32 NDataPos uint32 NUndoPos uint32 HashPrev blockchainparser.Hash256 HashMerkleRoot blockchainparser.Hash256 NTime time.Time NBits uint32 NNonce uint32 }
func GetBlockIndexRecord ¶
func GetBlockIndexRecord(indexDb *IndexDb, blockHash []byte) (*BlockIndexRecord, error)
func GetBlockIndexRecordByBigEndianHex ¶
func GetBlockIndexRecordByBigEndianHex(indexDb *IndexDb, blockHash string) (*BlockIndexRecord, error)
func GetBlockIndexRecordByHex ¶
func GetBlockIndexRecordByHex(indexDb *IndexDb, blockHash string) (*BlockIndexRecord, error)
func NewBlockIndexRecordFromBytes ¶
func NewBlockIndexRecordFromBytes(b []byte) *BlockIndexRecord
type ChainstateDb ¶
func OpenChainstateDb ¶
func OpenChainstateDb(blockchainDataDir string) (*ChainstateDb, error)
type DataBuf ¶
type DataBuf struct {
// contains filtered or unexported fields
}
TODO: Improve this to use Buffer interface
func NewDataBuf ¶
func (*DataBuf) Shift16bit ¶
func (*DataBuf) Shift32bit ¶
func (*DataBuf) Shift64bit ¶
func (*DataBuf) ShiftBytes ¶
func (*DataBuf) ShiftU32bit ¶
func (*DataBuf) ShiftU64bit ¶
func (*DataBuf) ShiftVarint ¶
type FileInfoRecord ¶
type FileInfoRecord struct { NumOfBlocks uint32 Size uint32 UndoSize uint32 HeightFirst uint32 HeightLast uint32 TimeFirst time.Time TimeLast time.Time }
func GetFileInfoRecord ¶
func GetFileInfoRecord(indexDb *IndexDb, number uint32) (*FileInfoRecord, error)
func NewFileInfoRecordFromBytes ¶
func NewFileInfoRecordFromBytes(b []byte) *FileInfoRecord
type IndexDb ¶
func OpenIndexDb ¶
type TxIndexRecord ¶
func GetTxIndexRecord ¶
func GetTxIndexRecord(indexDb *IndexDb, txHash []byte) (*TxIndexRecord, error)
func GetTxIndexRecordByBigEndianHex ¶
func GetTxIndexRecordByBigEndianHex(indexDb *IndexDb, txHash string) (*TxIndexRecord, error)
func GetTxIndexRecordByHex ¶
func GetTxIndexRecordByHex(indexDb *IndexDb, txHash string) (*TxIndexRecord, error)
func NewTxIndexRecordFromBytes ¶
func NewTxIndexRecordFromBytes(b []byte) *TxIndexRecord
Click to show internal directories.
Click to hide internal directories.