BlockHeaderDatabase

Functions

Link copied to clipboard
abstract fun clear()
Link copied to clipboard
abstract fun close()
Link copied to clipboard
abstract fun diffUpsert(header: iBlockHeader)
Link copied to clipboard
Link copied to clipboard
abstract fun getHeader(hash: ByteArray): iBlockHeader?

If a header identified by this hash does not exist, return null

abstract fun getHeader(height: Long): iBlockHeader?

Get a main chain (a chain with the most work) header by its height

abstract fun getHeader(hash: Hash256): iBlockHeader?
Link copied to clipboard
abstract fun getHeadersAtHeight(height: Long): List<iBlockHeader>

Multiple chains may exist at this height so a list is returned

Link copied to clipboard
Link copied to clipboard
abstract fun insertHeader(header: iBlockHeader)
Link copied to clipboard
abstract fun setCachedTipHeader(header: iBlockHeader)
Link copied to clipboard
abstract fun upsert(headers: Collection<iBlockHeader>)