// proposeBlock takes all transactions from the first quarter of the mempool
// and creates a new block, which will be proposed to be finalized as the
// next block in the chain.
proposeBlock takes all transactions from the first quarter of the mempool
and creates a new block, which will be proposed to be finalized as the
next block in the chain.
// proposeBlock takes all transactions from the first quarter of the mempool // and creates a new block which will be proposed to be finalized as the // next block in the chain .
func (l *Ledger) proposeBlock() *Block {
	proposing := l.transactions.ProposableIDs()
	if len(proposing) == 0 {
		return nil
	}
	latest := l.blocks.Latest()
	results, err := l.collapseTransactions(latest.Index+1, latest, proposing, false)
	if err != nil {
		logger := log.Node()
		logger.Error().
			Err(err).
			Msg("error collapsing transactions during block proposal")
		return nil
	}
	proposed := NewBlock(latest.Index+1, results.snapshot.Checksum(), proposing...)
	return &proposed
}
func ( l * Ledger ) proposeBlock ( ) * Block { proposing := l . transactions . ProposableIDs ( ) if len ( proposing ) == 0 { return nil } latest := l . blocks . Latest ( ) results , err := l . collapseTransactions ( latest . Index + 1 , latest , proposing , false ) if err != nil { logger := log . Node ( ) logger . Error ( ) . Err ( err ) . Msg ( " " ) return nil } proposed := NewBlock ( latest . Index + 1 , results . snapshot . Checksum ( ) , proposing ... ) return & proposed }
proposeBlock takes all transactions from the first quarter of the mempool
and creates a new block, which will be proposed to be finalized as the
next block in the chain.
proposeBlock takes all transactions from the first quarter of the mempool and creates a new block which will be proposed to be finalized as the next block in the chain .