We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
TestStateRecovery
1 parent df8059f commit 9d52234Copy full SHA for 9d52234
node/helpers.go
@@ -1,7 +1,7 @@
1
-//nolint:unused
2
package node
3
4
import (
+ "context"
5
"errors"
6
"fmt"
7
"time"
@@ -75,10 +75,7 @@ func getNodeHeightFromData(node Node) (uint64, error) {
75
76
func getNodeHeightFromStore(node Node) (uint64, error) {
77
if fn, ok := node.(*FullNode); ok {
78
- if fn.blockComponents != nil {
79
- state := fn.blockComponents.GetLastState()
80
- return state.LastBlockHeight, nil
81
- }
+ return fn.Store.Height(context.Background())
82
}
83
return 0, errors.New("not a full node or block components not initialized")
84
0 commit comments