Ori Newman 7f2ef708a6
[NOD-1506] Implement SetPruningPointUTXOSet (#996)
* [NOD-1506] Implement SetPruningPointUTXOSet

* [NOD-1506] Rename ErrHeaderlessBlockInIBD->ErrMissingBlockHeaderInIBD

* [NOD-1506] Change virtualHeaderHash
2020-11-03 18:24:45 +02:00

35 lines
810 B
Go

package externalapi
// Each of the following represent one of the possible sync
// states of the consensus
const (
SyncStateNormal SyncState = iota
SyncStateMissingUTXOSet
SyncStateHeadersFirst
SyncStateMissingBlockBodies
)
// SyncState represents the current sync state of the consensus
type SyncState uint8
func (s SyncState) String() string {
switch s {
case SyncStateNormal:
return "SyncStateNormal"
case SyncStateMissingUTXOSet:
return "SyncStateMissingUTXOSet"
case SyncStateHeadersFirst:
return "SyncStateHeadersFirst"
case SyncStateMissingBlockBodies:
return "SyncStateMissingBlockBodies"
}
return "<unknown state>"
}
// SyncInfo holds info about the current sync state of the consensus
type SyncInfo struct {
State SyncState
IBDRootUTXOBlockHash *DomainHash
}