mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-06-03 20:56:42 +00:00

* Implement isBlockRewardFixed. * Fix factory.go. * Call isBlockRewardFixed from calcBlockSubsidy. * Fix bad call to ghostdagDataStore.Get. * Extract blue score and blue work from the header instead of from the ghostdagDataStore. * Fix coinbasemanager constructor arguments order * Format consensus_defaults.go * Check the mainnet switch from the block's point of view rather than the virtual's. * Don't call newBlockPruningPoint twice in buildBlock. * Properly handle new pruning point blocks in isBlockRewardFixed. * Use the correct variable. * Add a comment explaining what we do when the pruning point is not found in isBlockRewardFixed. * Implement TestBlockRewardSwitch. * Add missing error handling. Co-authored-by: Ori Newman <orinewman1@gmail.com>
13 lines
737 B
Go
13 lines
737 B
Go
package model
|
|
|
|
import "github.com/kaspanet/kaspad/domain/consensus/model/externalapi"
|
|
|
|
// CoinbaseManager exposes methods for handling blocks'
|
|
// coinbase transactions
|
|
type CoinbaseManager interface {
|
|
ExpectedCoinbaseTransaction(stagingArea *StagingArea, blockHash *externalapi.DomainHash,
|
|
coinbaseData *externalapi.DomainCoinbaseData, blockPruningPoint *externalapi.DomainHash) (*externalapi.DomainTransaction, error)
|
|
CalcBlockSubsidy(stagingArea *StagingArea, blockHash *externalapi.DomainHash, blockPruningPoint *externalapi.DomainHash) (uint64, error)
|
|
ExtractCoinbaseDataBlueScoreAndSubsidy(coinbaseTx *externalapi.DomainTransaction) (blueScore uint64, coinbaseData *externalapi.DomainCoinbaseData, subsidy uint64, err error)
|
|
}
|