Documentation ¶
Index ¶
- Constants
- func MinerReward(miner types.Address, amount int) *types.Transaction
- func NewValidator(c *Chain) *validator
- type BlkIterator
- type Chain
- type IterType
- type MemSet
- type Miner
- type State
- func (s *State) GenesisUpdate(b *types.Block)
- func (s *State) GetMemTokens(account types.Account) []*types.UTXO
- func (s *State) GetStableSet() *types.UtxoSet
- func (s *State) GetTokens(account types.Account) []*types.UTXO
- func (s *State) Handler(wg *sync.WaitGroup)
- func (s *State) Load() error
- func (s *State) MinerIsStarting(start bool)
- func (s *State) StateTransition(o any, local bool)
- func (s *State) SyncMemSet(tokens map[types.Account][]*types.UTXO)
- type Transactions
- type TxPool
- type Validator
Constants ¶
View Source
const (
BlockMaxTransactions = 4
)
Variables ¶
This section is empty.
Functions ¶
func MinerReward ¶
func MinerReward(miner types.Address, amount int) *types.Transaction
func NewValidator ¶
func NewValidator(c *Chain) *validator
Types ¶
type BlkIterator ¶
type BlkIterator struct {
// contains filtered or unexported fields
}
type Chain ¶
type Chain struct { Mu *sync.Mutex ChainId types.Chainid Node *types.Node Config config.Config ChainHeight uint64 LastBlock types.Block TxPool pool ChainState chainstate DB database.DB Engine consensus.Engin Validator Validator MinerAdd types.Address Miner miner DBPath string Port int MinedBlockCh chan *types.Block }
TODO: add memChain in Chain struct
func (*Chain) SetupChain ¶
type MemSet ¶
func (*MemSet) ConvertMem2Stable ¶
type Miner ¶
type Miner struct {
// contains filtered or unexported fields
}
func (*Miner) MineGenesis ¶
func (m *Miner) MineGenesis(tx *types.Transaction)
type State ¶
func (*State) GenesisUpdate ¶
func (*State) GetStableSet ¶
func (*State) MinerIsStarting ¶
func (*State) StateTransition ¶
type Transactions ¶
type Transactions map[txid]*types.Transaction
type TxPool ¶
func (*TxPool) ContinueHandler ¶
func (*TxPool) GetPending ¶
func (tp *TxPool) GetPending() []*types.Transaction
func (*TxPool) GetQueue ¶
func (tp *TxPool) GetQueue() []*types.Transaction
func (*TxPool) GetWaitGroup ¶
func (*TxPool) UpdatePool ¶
this function add transactions that added to mined block that recieved from other nodes
Source Files ¶
Click to show internal directories.
Click to hide internal directories.