mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-05-23 15:26:42 +00:00

* Fix notifyVirtualSelectedParentBlueScoreChanged to show the selected tip blue score instead of the virtual's * Fix ShouldMine() to fetch selected tip header
28 lines
1.5 KiB
Go
28 lines
1.5 KiB
Go
package externalapi
|
|
|
|
// Consensus maintains the current core state of the node
|
|
type Consensus interface {
|
|
BuildBlock(coinbaseData *DomainCoinbaseData, transactions []*DomainTransaction) (*DomainBlock, error)
|
|
ValidateAndInsertBlock(block *DomainBlock) (*BlockInsertionResult, error)
|
|
ValidateTransactionAndPopulateWithConsensusData(transaction *DomainTransaction) error
|
|
|
|
GetBlock(blockHash *DomainHash) (*DomainBlock, error)
|
|
GetBlockHeader(blockHash *DomainHash) (*DomainBlockHeader, error)
|
|
GetBlockInfo(blockHash *DomainHash) (*BlockInfo, error)
|
|
GetBlockAcceptanceData(blockHash *DomainHash) (AcceptanceData, error)
|
|
|
|
GetHashesBetween(lowHash, highHash *DomainHash, maxBlueScoreDifference uint64) ([]*DomainHash, error)
|
|
GetMissingBlockBodyHashes(highHash *DomainHash) ([]*DomainHash, error)
|
|
GetPruningPointUTXOSet(expectedPruningPointHash *DomainHash) ([]byte, error)
|
|
PruningPoint() (*DomainHash, error)
|
|
ValidateAndInsertPruningPoint(newPruningPoint *DomainBlock, serializedUTXOSet []byte) error
|
|
GetVirtualSelectedParent() (*DomainHash, error)
|
|
CreateBlockLocator(lowHash, highHash *DomainHash, limit uint32) (BlockLocator, error)
|
|
FindNextBlockLocatorBoundaries(blockLocator BlockLocator) (lowHash, highHash *DomainHash, err error)
|
|
GetSyncInfo() (*SyncInfo, error)
|
|
Tips() ([]*DomainHash, error)
|
|
GetVirtualInfo() (*VirtualInfo, error)
|
|
IsValidPruningPoint(blockHash *DomainHash) (bool, error)
|
|
GetVirtualSelectedParentChainFromBlock(blockHash *DomainHash) (*SelectedParentChainChanges, error)
|
|
}
|