mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-10-13 16:49:24 +00:00
[NOD-839] Panic from non-rule error from ProcessBlock (#660)
This commit is contained in:
parent
34fb066590
commit
e58efbf0ea
@ -13,7 +13,6 @@ import (
|
||||
|
||||
"github.com/kaspanet/kaspad/blockdag"
|
||||
"github.com/kaspanet/kaspad/dagconfig"
|
||||
"github.com/kaspanet/kaspad/database"
|
||||
"github.com/kaspanet/kaspad/mempool"
|
||||
peerpkg "github.com/kaspanet/kaspad/peer"
|
||||
"github.com/kaspanet/kaspad/util"
|
||||
@ -495,18 +494,12 @@ func (sm *SyncManager) handleBlockMsg(bmsg *blockMsg) {
|
||||
// rejected as opposed to something actually going wrong, so log
|
||||
// it as such. Otherwise, something really did go wrong, so log
|
||||
// it as an actual error.
|
||||
if errors.As(err, &blockdag.RuleError{}) {
|
||||
if !errors.As(err, &blockdag.RuleError{}) {
|
||||
panic(errors.Wrapf(err, "Failed to process block %s",
|
||||
blockHash))
|
||||
}
|
||||
log.Infof("Rejected block %s from %s: %s", blockHash,
|
||||
peer, err)
|
||||
} else {
|
||||
log.Errorf("Failed to process block %s: %s",
|
||||
blockHash, err)
|
||||
}
|
||||
var dbErr database.Error
|
||||
if ok := errors.As(err, &dbErr); ok && dbErr.ErrorCode ==
|
||||
database.ErrCorruption {
|
||||
panic(dbErr)
|
||||
}
|
||||
|
||||
// Convert the error into an appropriate reject message and
|
||||
// send it.
|
||||
|
Loading…
x
Reference in New Issue
Block a user