// collapseTransactions takes all transactions recorded within a block, and applies all valid
// and available ones to a snapshot of all accounts stored in the ledger. It returns an updated
// snapshot with all finalized transactions applied, alongside count summaries of the number of
// applied, rejected, or otherwise ignored transactions.
collapseTransactions takes all transactions recorded within a block, and applies all valid
and available ones to a snapshot of all accounts stored in the ledger. It returns an updated
snapshot with all finalized transactions applied, alongside count summaries of the number of
applied, rejected, or otherwise ignored transactions.
// collapseTransactions takes all transactions recorded within a block and applies all valid // and available ones to a snapshot of all accounts stored in the ledger . It returns an updated // snapshot with all finalized transactions applied alongside count summaries of the number of // applied rejected or otherwise ignored transactions .
func (l *Ledger) collapseTransactions(
	height uint64, current *Block, proposed []TransactionID, logging bool,
) (*collapseResults, error) {
	transactions, err := l.transactions.BatchFind(proposed)
	if err != nil {
		return nil, errors.Wrap(err, "could not find transactions to collapse in node")
	}
	results, err := collapseTransactions(height, transactions, current, l.accounts)
	if err != nil {
		return nil, errors.Wrap(err, "failed to collapse transactions")
	}
	if logging && results != nil {
		l.collapseResultsLogger.Log(results)
	}
	return results, err
}
func ( l * Ledger ) collapseTransactions ( height uint64 , current * Block , proposed [ ] TransactionID , logging bool , ) ( * collapseResults , error ) { transactions , err := l . transactions . BatchFind ( proposed ) if err != nil { return nil , errors . Wrap ( err , " " ) } results , err := collapseTransactions ( height , transactions , current , l . accounts ) if err != nil { return nil , errors . Wrap ( err , " " ) } if logging && results != nil { l . collapseResultsLogger . Log ( results ) } return results , err }
collapseTransactions takes all transactions recorded within a block, and applies all valid
and available ones to a snapshot of all accounts stored in the ledger.
collapseTransactions takes all transactions recorded within a block and applies all valid and available ones to a snapshot of all accounts stored in the ledger .