mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-05-22 14:56:44 +00:00
22 lines
661 B
Go
22 lines
661 B
Go
package consensus
|
|
|
|
import (
|
|
"github.com/kaspanet/kaspad/domain/consensus/model"
|
|
"github.com/kaspanet/kaspad/domain/consensus/model/externalapi"
|
|
)
|
|
|
|
type testConsensus struct {
|
|
*consensus
|
|
testBlockBuilder model.TestBlockBuilder
|
|
}
|
|
|
|
func (tc *testConsensus) BuildBlockWithParents(parentHashes []*externalapi.DomainHash, coinbaseData *externalapi.DomainCoinbaseData,
|
|
transactions []*externalapi.DomainTransaction) (*externalapi.DomainBlock, error) {
|
|
|
|
// Require write lock because BuildBlockWithParents stages temporary data
|
|
tc.lock.Lock()
|
|
defer tc.lock.Unlock()
|
|
|
|
return tc.testBlockBuilder.BuildBlockWithParents(parentHashes, coinbaseData, transactions)
|
|
}
|