mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-05-22 23:07:04 +00:00

* [NOD-1496] Implement headers only verification * [NOD-1496] Add checkParentsExist * [NOD-1496] Stage block statuses in block processor * [NOD-1496] Rename AddBlock->AddHeaderTip * [NOD-1496] Return early from validateAndInsertBlock on header only and put ValidateProofOfWorkAndDifficulty inside validateBlock
18 lines
534 B
Go
18 lines
534 B
Go
package serialization
|
|
|
|
import (
|
|
"github.com/kaspanet/kaspad/domain/consensus/model/externalapi"
|
|
)
|
|
|
|
// HeaderTipsToDBHeaderTips converts a slice of hashes to DbHeaderTips
|
|
func HeaderTipsToDBHeaderTips(tips []*externalapi.DomainHash) *DbHeaderTips {
|
|
return &DbHeaderTips{
|
|
Tips: DomainHashesToDbHashes(tips),
|
|
}
|
|
}
|
|
|
|
// DBHeaderTipsTOHeaderTips converts DbHeaderTips to a slice of hashes
|
|
func DBHeaderTipsTOHeaderTips(dbHeaderTips *DbHeaderTips) ([]*externalapi.DomainHash, error) {
|
|
return DbHashesToDomainHashes(dbHeaderTips.Tips)
|
|
}
|