stasatdaglabs a96a5fd2ef
[NOD-1462] Simplify consensus external API (#958)
* [NOD-1461] Change the external api interface to not having anything besides DomainTransactions and DomainBlocks.

* [NOD-1462] Move external api types to a separate package.

* [NOD-1462] Clarify which model we're using in miningmanager.

* [NOD-1462] Extract coinbase data to its own struct.

* [NOD-1462] Add a comment above CoinbaseData.

* [NOD-1462] Fix the comment above CoinbaseData.
2020-10-19 17:59:04 +03:00

37 lines
1.0 KiB
Go

package mempool
import (
"github.com/kaspanet/kaspad/domain/consensus"
consensusexternalapi "github.com/kaspanet/kaspad/domain/consensus/model/externalapi"
miningmanagermodel "github.com/kaspanet/kaspad/domain/miningmanager/model"
)
// mempool maintains a set of known transactions that
// are intended to be mined into new blocks
type mempool struct {
consensus *consensus.Consensus
}
// New creates a new mempool
func New(consensus *consensus.Consensus) miningmanagermodel.Mempool {
return &mempool{
consensus: consensus,
}
}
// HandleNewBlock handles a new block that was just added to the DAG
func (mp *mempool) HandleNewBlock(block *consensusexternalapi.DomainBlock) {
}
// Transactions returns all the transactions in the mempool
func (mp *mempool) Transactions() []*consensusexternalapi.DomainTransaction {
return nil
}
// ValidateAndInsertTransaction validates the given transaction, and
// adds it to the mempool
func (mp *mempool) ValidateAndInsertTransaction(transaction *consensusexternalapi.DomainTransaction) error {
return nil
}