mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-09-14 13:30:11 +00:00

* [NOD-1595] Implement all fields of GetBlockDAGInfo * [NOD-1595] * [NOD-1595] Don't swallow errors in GetDifficultyRatio * [NOD-1595] Change roundingPrecision in GetDifficultyRatio to 2 decimal places
24 lines
1.1 KiB
Go
24 lines
1.1 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) error
|
|
ValidateTransactionAndPopulateWithConsensusData(transaction *DomainTransaction) error
|
|
|
|
GetBlock(blockHash *DomainHash) (*DomainBlock, error)
|
|
GetBlockHeader(blockHash *DomainHash) (*DomainBlockHeader, error)
|
|
GetBlockInfo(blockHash *DomainHash) (*BlockInfo, error)
|
|
|
|
GetHashesBetween(lowHash, highHash *DomainHash) ([]*DomainHash, error)
|
|
GetMissingBlockBodyHashes(highHash *DomainHash) ([]*DomainHash, error)
|
|
GetPruningPointUTXOSet(expectedPruningPointHash *DomainHash) ([]byte, error)
|
|
SetPruningPointUTXOSet(serializedUTXOSet []byte) error
|
|
GetVirtualSelectedParent() (*DomainBlock, 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)
|
|
}
|