Documentation ¶
Index ¶
- Constants
- type AtxMemPool
- type AtxValidator
- type BlockBuilder
- type HareResultProvider
- type Projector
- type Signer
- type Syncer
- type TxMempool
- func (t *TxMempool) Get(id types.TransactionId) (*types.Transaction, error)
- func (t *TxMempool) GetProjection(addr types.Address, prevNonce, prevBalance uint64) (nonce, balance uint64)
- func (t *TxMempool) GetTxIdsByAddress(addr types.Address) []types.TransactionId
- func (t *TxMempool) GetTxsForBlock(numOfTxs int, ...) ([]types.TransactionId, error)
- func (t *TxMempool) Invalidate(id types.TransactionId)
- func (t *TxMempool) Put(id types.TransactionId, tx *types.Transaction)
- type TxPool
- type TxValidator
- type WeakCoinProvider
Constants ¶
View Source
const AtxsPerBlockLimit = 100
View Source
const DefaultFee = 1
View Source
const DefaultGasLimit = 10
View Source
const IncomingTxProtocol = "TxGossip"
View Source
const MaxAtxPerBlock = 200 //todo: move to config
View Source
const MaxTransactionsPerBlock = 20 //todo: move to config
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AtxMemPool ¶
type AtxMemPool struct {
// contains filtered or unexported fields
}
func NewAtxMemPool ¶
func NewAtxMemPool() *AtxMemPool
func (*AtxMemPool) Get ¶
func (mem *AtxMemPool) Get(id types.AtxId) (*types.ActivationTx, error)
func (*AtxMemPool) GetAllItems ¶
func (mem *AtxMemPool) GetAllItems() []*types.ActivationTx
func (*AtxMemPool) Invalidate ¶
func (mem *AtxMemPool) Invalidate(id types.AtxId)
func (*AtxMemPool) Put ¶
func (mem *AtxMemPool) Put(atx *types.ActivationTx)
type AtxValidator ¶
type AtxValidator interface {
SyntacticallyValidateAtx(atx *types.ActivationTx) error
}
type BlockBuilder ¶
type BlockBuilder struct { log.Log Signer AtxPool *AtxMemPool TransactionPool TxPool // contains filtered or unexported fields }
func NewBlockBuilder ¶
func NewBlockBuilder(minerID types.NodeId, sgn Signer, net p2p.Service, beginRoundEvent chan types.LayerID, hdist int, txPool TxPool, atxPool *AtxMemPool, weakCoin WeakCoinProvider, orph meshProvider, hare HareResultProvider, blockOracle oracle.BlockOracle, txValidator TxValidator, atxValidator AtxValidator, syncer Syncer, atxsPerBlock int, projector Projector, lg log.Log) *BlockBuilder
func (*BlockBuilder) AddTransaction ¶
func (t *BlockBuilder) AddTransaction(tx *types.Transaction) error
used from external API call?
func (*BlockBuilder) Close ¶
func (t *BlockBuilder) Close() error
func (*BlockBuilder) Start ¶
func (t *BlockBuilder) Start() error
func (*BlockBuilder) ValidateAndAddTxToPool ¶
func (t *BlockBuilder) ValidateAndAddTxToPool(tx *types.Transaction) error
type HareResultProvider ¶
type TxMempool ¶
type TxMempool struct {
// contains filtered or unexported fields
}
func NewTxMemPool ¶
func NewTxMemPool() *TxMempool
func (*TxMempool) Get ¶
func (t *TxMempool) Get(id types.TransactionId) (*types.Transaction, error)
func (*TxMempool) GetProjection ¶
func (*TxMempool) GetTxIdsByAddress ¶
func (t *TxMempool) GetTxIdsByAddress(addr types.Address) []types.TransactionId
func (*TxMempool) GetTxsForBlock ¶
func (*TxMempool) Invalidate ¶
func (t *TxMempool) Invalidate(id types.TransactionId)
func (*TxMempool) Put ¶
func (t *TxMempool) Put(id types.TransactionId, tx *types.Transaction)
type TxPool ¶
type TxPool interface { GetTxsForBlock(numOfTxs int, getState func(addr types.Address) (nonce, balance uint64, err error)) ([]types.TransactionId, error) Put(id types.TransactionId, item *types.Transaction) Invalidate(id types.TransactionId) }
type TxValidator ¶
type WeakCoinProvider ¶
type WeakCoinProvider interface {
GetResult() bool
}
Click to show internal directories.
Click to hide internal directories.