# Functions
DefaultTxPoolConfig returns the default configuration of the transaction pool.
DeleteLargerHeightBlocks deletes the height-to-hash mappings with larger height in the canonical chain.
GetGenesis gets the genesis block according to accounts' balance.
NewBlockchain returns an initialized blockchain with the given store and account state DB.
NewBlockIndex constructs and returns a BlockIndex instance.
NewBlockLeaves constructs and returns a NewBlockLeaves instance.
10 * 60 * 60s / 15(s) (block) * 500txs/block = 1.2M txs 500 txs = 10KB, so total 1.2M txs will take up 24MB size.
No description provided by the author
No description provided by the author
NewEventPool creates and returns an event pool.
No description provided by the author
NewHeaderChain returns a new instance of the HeaderChain structure.
NewPool creates and returns a transaction pool.
No description provided by the author
No description provided by the author
NewTransactionPool creates and returns a transaction pool.
OverwriteStaleBlocks overwrites the stale canonical height-to-hash mappings.
ValidateBlockHeader validates the specified header.
# Constants
BlockByteLimit is the limit of size in bytes.
BlockTransactionNumberLimit block transaction number limit, 1000 simple transactions are about 152kb If for block size as 100KB, it could contains about 5k transactions.
No description provided by the author
No description provided by the author
once CachedTxs reach max, 1/PercentDelete of capacity will be randomly deleted.
# Variables
No description provided by the author
DebtManagerPoolCapacity capacity for to-be-sent debt in real test.
DebtPoolCapacity we need bigger capacity to hold more debt in real test.
ErrBlockAlreadyExists is returned when inserted block already exists.
ErrBlockCreateTimeInFuture is returned when block create time is ahead of 10 seconds of now.
ErrBlockCreateTimeNull is returned when block create time is nil.
ErrBlockEmptyTxs is returned when writing a block with empty transactions.
ErrBlockExtraDataNotEmpty is returned when the block extra data is not empty.
ErrBlockReceiptHashMismatch is returned when the calculated receipts hash of block does not match the receipts root hash in block header.
ErrBlockStateHashMismatch is returned when the calculated account state hash of block does not match the state root hash in block header.
ErrBlockTooManyTxs is returned when block have too many txs.
ErrGenesisHashMismatch is returned when the genesis block hash between the store and memory mismatch.
ErrGenesisNotFound is returned when genesis block not found in the store.
ErrNotSupported is returned when unsupported method invoked.
ToConfirmedDebtCapacity capacity for to confirmed debt map in real test.
# Structs
Blockchain represents the blockchain with a genesis block.
BlockIndex is the index of the block chain.
BlockLeaves is the block leaves used for block forking Note that BlockLeaves is not thread safe.
No description provided by the author
No description provided by the author
DebtPool debt pool.
EventPool event pool.
Genesis represents the genesis block in the blockchain.
GenesisInfo genesis info for generating genesis block, it could be used for initializing account balance.
HeaderChain represents the block header chain that is shared by the archive node and light node.
Pool is a thread-safe container for block object received from the network or submitted locally.
TransactionPool is a thread-safe container for transactions received from the network or submitted locally.
TransactionPoolConfig is the configuration of the transaction pool.