func (s *ShardMempool) RemoveTransactionsFromBlock(block *primitives.ShardBlock) {
	s.mempoolLock.Lock()
	defer s.mempoolLock.Unlock()

	newOrder := make([]*shardMempoolItem, 0, len(s.mempoolOrder))
	for _, tx := range block.Body.Transactions {
		txHash := chainhash.HashH(tx.TransactionData)
		delete(s.mempool, txHash)
	}

	for _, tx := range s.mempoolOrder {
		txHash := chainhash.HashH(tx.tx)
		if _, found := s.mempool[txHash]; found {
			newOrder = append(newOrder, tx)
		}
	}

	s.mempoolOrder = newOrder
}
// RemoveTransactionsFromBlock removes transactions from the mempool that were included in a block.
RemoveTransactionsFromBlock removes transactions from the mempool that were included in a block.
// RemoveTransactionsFromBlock removes transactions from the mempool that were included in a block .
func (s *ShardMempool) RemoveTransactionsFromBlock(block *primitives.ShardBlock) {
	s.mempoolLock.Lock()
	defer s.mempoolLock.Unlock()
	newOrder := make([]*shardMempoolItem, 0, len(s.mempoolOrder))
	for _, tx := range block.Body.Transactions {
		txHash := chainhash.HashH(tx.TransactionData)
		delete(s.mempool, txHash)
	}
	for _, tx := range s.mempoolOrder {
		txHash := chainhash.HashH(tx.tx)
		if _, found := s.mempool[txHash]; found {
			newOrder = append(newOrder, tx)
		}
	}
	s.mempoolOrder = newOrder
}
func ( s * ShardMempool ) RemoveTransactionsFromBlock ( block * primitives . ShardBlock ) { s . mempoolLock . Lock ( ) defer s . mempoolLock . Unlock ( ) newOrder := make ( [ ] * shardMempoolItem , 0 , len ( s . mempoolOrder ) ) for _ , tx := range block . Body . Transactions { txHash := chainhash . HashH ( tx . TransactionData ) delete ( s . mempool , txHash ) } for _ , tx := range s . mempoolOrder { txHash := chainhash . HashH ( tx . tx ) if _ , found := s . mempool [ txHash ] ; found { newOrder = append ( newOrder , tx ) } } s . mempoolOrder = newOrder }
RemoveTransactionsFromBlock removes transactions from the mempool that were included in a block.
RemoveTransactionsFromBlock removes transactions from the mempool that were included in a block .