mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-05-30 02:36:42 +00:00

* Add cache to block window * Copy the window heap slice with the right capacity * Use WindowHeapSliceStore * Use the selected parent window as a basis (and some comments and variable renames) * Clone slice on newSizedUpHeapFromSlice * Rename isNotFoundError->currentIsNonTrustedBlock * Increase windowHeapSliceStore cache size to 2000 and some cosmetic changes
12 lines
560 B
Go
12 lines
560 B
Go
package model
|
|
|
|
import "github.com/kaspanet/kaspad/domain/consensus/model/externalapi"
|
|
|
|
// WindowHeapSliceStore caches the slices that are needed for the heap implementation of DAGTraversalManager.BlockWindow
|
|
type WindowHeapSliceStore interface {
|
|
Store
|
|
Stage(stagingArea *StagingArea, blockHash *externalapi.DomainHash, windowSize int, pairs []*externalapi.BlockGHOSTDAGDataHashPair)
|
|
IsStaged(stagingArea *StagingArea) bool
|
|
Get(stagingArea *StagingArea, blockHash *externalapi.DomainHash, windowSize int) ([]*externalapi.BlockGHOSTDAGDataHashPair, error)
|
|
}
|