mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-11-24 06:25:55 +00:00
24 lines
501 B
Go
24 lines
501 B
Go
package syncmanager
|
|
|
|
import (
|
|
"github.com/kaspanet/kaspad/domain/consensus/model/externalapi"
|
|
)
|
|
|
|
func (sm *syncManager) syncInfo() (*externalapi.SyncInfo, error) {
|
|
headerCount := sm.getHeaderCount()
|
|
blockCount := sm.getBlockCount()
|
|
|
|
return &externalapi.SyncInfo{
|
|
HeaderCount: headerCount,
|
|
BlockCount: blockCount,
|
|
}, nil
|
|
}
|
|
|
|
func (sm *syncManager) getHeaderCount() uint64 {
|
|
return sm.blockHeaderStore.Count()
|
|
}
|
|
|
|
func (sm *syncManager) getBlockCount() uint64 {
|
|
return sm.blockStore.Count()
|
|
}
|