mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-03-30 15:08:33 +00:00
Fix pruning candidate (#1821)
This commit is contained in:
parent
7b5720a155
commit
ba5880fab1
@ -60,7 +60,7 @@ func (ps *pruningStore) PruningPointCandidate(dbContext model.DBReader, stagingA
|
||||
return ps.pruningPointCandidateCache, nil
|
||||
}
|
||||
|
||||
candidateBytes, err := dbContext.Get(ps.pruningBlockHashKey)
|
||||
candidateBytes, err := dbContext.Get(ps.candidatePruningPointHashKey)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package pruningmanager_test
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/kaspanet/kaspad/infrastructure/db/database"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
@ -107,7 +108,9 @@ func TestPruning(t *testing.T) {
|
||||
blockHashToID[*blockHash] = dagBlock.ID
|
||||
|
||||
pruningPointCandidate, err := tc.PruningStore().PruningPointCandidate(tc.DatabaseContext(), stagingArea)
|
||||
if err != nil {
|
||||
if database.IsNotFoundError(err) {
|
||||
pruningPointCandidate = consensusConfig.GenesisHash
|
||||
} else if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user