Small fix in proof-of-work log (#1205)

This commit is contained in:
Svarog 2020-12-09 18:31:36 +02:00 committed by GitHub
parent 3354ac67c8
commit 6714e084e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,6 +4,7 @@ import (
"github.com/kaspanet/kaspad/domain/consensus/model/externalapi"
"github.com/kaspanet/kaspad/domain/consensus/model/pow"
"github.com/kaspanet/kaspad/domain/consensus/ruleerrors"
"github.com/kaspanet/kaspad/domain/consensus/utils/consensushashing"
"github.com/kaspanet/kaspad/util"
"github.com/pkg/errors"
)
@ -155,9 +156,9 @@ func (v *blockValidator) checkPruningPointViolation(header *externalapi.DomainBl
if err != nil {
return err
}
if isAncestorOfAny {
return nil
if !isAncestorOfAny {
return errors.Wrapf(ruleerrors.ErrPruningPointViolation,
"expected pruning point %s to be in block %s past.", pruningPoint, consensushashing.HeaderHash(header))
}
return errors.Wrapf(ruleerrors.ErrPruningPointViolation,
"expected pruning point to be in block %d past.", header.Bits)
return nil
}