mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-05-30 10:46:41 +00:00

* Make TransactionOutputEstimatedSerializedSize public * Update the mempool interface * Refactor the mempool to the new design * refactor txselection and blocktemplatebuilder to the new design * Update the mining manager * Update the MiningManager factory * mempool fix requested changed
31 lines
891 B
Go
31 lines
891 B
Go
package miningmanager
|
|
|
|
import (
|
|
"github.com/kaspanet/kaspad/domain/consensus"
|
|
"github.com/kaspanet/kaspad/domain/miningmanager/blocktemplatebuilder"
|
|
mempoolpkg "github.com/kaspanet/kaspad/domain/miningmanager/mempool"
|
|
)
|
|
|
|
// Factory instantiates new mining managers
|
|
type Factory interface {
|
|
NewMiningManager(consensus consensus.Consensus, blockMaxMass uint64) MiningManager
|
|
}
|
|
|
|
type factory struct{}
|
|
|
|
// NewMiningManager instantiate a new mining manager
|
|
func (f *factory) NewMiningManager(consensus consensus.Consensus, blockMaxMass uint64) MiningManager {
|
|
mempool := mempoolpkg.New(consensus)
|
|
blockTemplateBuilder := blocktemplatebuilder.New(consensus, mempool, blockMaxMass)
|
|
|
|
return &miningManager{
|
|
mempool: mempool,
|
|
blockTemplateBuilder: blockTemplateBuilder,
|
|
}
|
|
}
|
|
|
|
// NewFactory creates a new mining manager factory
|
|
func NewFactory() Factory {
|
|
return &factory{}
|
|
}
|