Documentation ¶
Index ¶
- Variables
- func ApplyTransaction(tx *types.Transaction)
- type BlockChain
- func (bc *BlockChain) ApplyTransaction(tx *types.Transaction)
- func (bc *BlockChain) BlockAt(index uint64) *types.Block
- func (bc *BlockChain) CurrentBlock() *types.Block
- func (bc *BlockChain) Genesis() *types.Block
- func (bc *BlockChain) GetDB() xordb.Database
- func (bc *BlockChain) Insert(block *types.Block) error
- func (bc *BlockChain) InsertForBitcoin(block *types.Block) error
- func (bc *BlockChain) PrintBlockChain()
- type BlockValidator
- type Genesis
- type StateProcessor
- type TxPool
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // incorrect block's number (current_block_number + 1 != insert_block's_number) ErrWrongBlockNumber = errors.New("incorrect block number") ErrWrongParentHash = errors.New("block's parent hash does not match with current block") ErrTooHighHash = errors.New("block's hash is higher than difficulty") ErrWrongInterlink = errors.New("wrong interlink") )
View Source
var ( // ErrKnownBlock is returned when a block to import is already known locally. ErrKnownBlock = errors.New("block already known") // ErrNonceTooHigh is returned if the nonce of a transaction is higher than the // next one expected based on the local chain. ErrNonceTooHigh = errors.New("nonce too high") )
View Source
var ( // ErrInvalidSender is returned if the transaction contains an invalid signature. ErrInvalidSender = errors.New("invalid sender") // Prev nonce + 1 != Post nonce ErrIncorrectNonce = errors.New("incorrect nonce") // Prev/Post balance sum is different ErrIncorrectBalance = errors.New("incorrect balance") // Incorrect Prev state ErrIncorrectPrevState = errors.New("incorrect prev state") )
Reference : tx_pool.go#L43
Functions ¶
func ApplyTransaction ¶
func ApplyTransaction(tx *types.Transaction)
Types ¶
type BlockChain ¶
type BlockChain struct {
// contains filtered or unexported fields
}
func NewBlockChain ¶
func NewBlockChain(db xordb.Database) *BlockChain
func NewBlockChainForBitcoin ¶
func NewBlockChainForBitcoin(db xordb.Database) (*BlockChain, *ecdsa.PrivateKey)
func NewIoTBlockChain ¶
func NewIoTBlockChain(db xordb.Database, genesis *types.Block) *BlockChain
func (*BlockChain) ApplyTransaction ¶
func (bc *BlockChain) ApplyTransaction(tx *types.Transaction)
Apply transaction to state and save tx (for bitcoin data transform)
func (*BlockChain) CurrentBlock ¶
func (bc *BlockChain) CurrentBlock() *types.Block
func (*BlockChain) Genesis ¶
func (bc *BlockChain) Genesis() *types.Block
func (*BlockChain) GetDB ¶
func (bc *BlockChain) GetDB() xordb.Database
func (*BlockChain) Insert ¶
func (bc *BlockChain) Insert(block *types.Block) error
check block's validity, if ok, then insert block into chain
func (*BlockChain) InsertForBitcoin ¶
func (bc *BlockChain) InsertForBitcoin(block *types.Block) error
check block's validity, if ok, then insert block into chain
func (*BlockChain) PrintBlockChain ¶
func (bc *BlockChain) PrintBlockChain()
type BlockValidator ¶
type BlockValidator struct {
// contains filtered or unexported fields
}
func (*BlockValidator) ValidateBody ¶
func (v *BlockValidator) ValidateBody(block *types.Block) error
func (*BlockValidator) ValidateState ¶
func (v *BlockValidator) ValidateState(block *types.Block) error
type Genesis ¶
type Genesis struct { }
func DefaultGenesisBlock ¶
func DefaultGenesisBlock() *Genesis
type StateProcessor ¶
type StateProcessor struct {
// contains filtered or unexported fields
}
type TxPool ¶
type TxPool struct {
// contains filtered or unexported fields
}
Reference : tx_pool.go#L205
func NewTxPool ¶
func NewTxPool(chain *BlockChain) *TxPool
func (*TxPool) Chain ¶
func (pool *TxPool) Chain() *BlockChain
Source Files ¶
Click to show internal directories.
Click to hide internal directories.