mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-23 13:38:35 +00:00
3b7807e897
In this commit: 1. Request unknown MPT nodes from peers. Note, that StateSync module itself shouldn't be responsible for nodes requests, that's a server duty. 2. Do not request the same node twice, check if it is in storage already. If so, then the only thing remaining is to update refcounter.
20 lines
544 B
Go
20 lines
544 B
Go
package blockchainer
|
|
|
|
import (
|
|
"github.com/nspcc-dev/neo-go/pkg/core/mpt"
|
|
"github.com/nspcc-dev/neo-go/pkg/util"
|
|
)
|
|
|
|
// StateSync represents state sync module.
|
|
type StateSync interface {
|
|
AddMPTNodes([][]byte) error
|
|
Blockqueuer // Blockqueuer interface
|
|
Init(currChainHeight uint32) error
|
|
IsActive() bool
|
|
IsInitialized() bool
|
|
GetJumpHeight() (uint32, error)
|
|
GetUnknownMPTNodesBatch(limit int) []util.Uint256
|
|
NeedHeaders() bool
|
|
NeedMPTNodes() bool
|
|
Traverse(root util.Uint256, process func(node mpt.Node, nodeBytes []byte) bool) error
|
|
}
|