From 341a54554459b81557eebad338f995bda1717a71 Mon Sep 17 00:00:00 2001 From: muXxer Date: Wed, 14 Feb 2024 13:15:33 +0100 Subject: [PATCH] Fix broken error checks --- pkg/protocol/blocks.go | 2 +- pkg/protocol/engine/ledger/ledger/ledger.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/protocol/blocks.go b/pkg/protocol/blocks.go index 414c1262c..479033628 100644 --- a/pkg/protocol/blocks.go +++ b/pkg/protocol/blocks.go @@ -89,7 +89,7 @@ func (b *Blocks) ProcessResponse(block *model.Block, from peer.ID) { b.workerPool.Submit(func() { // abort if the commitment belongs to an evicted slot commitment, err := b.protocol.Commitments.Get(block.ProtocolBlock().Header.SlotCommitmentID, true) - if err != nil && ierrors.Is(ErrorSlotEvicted, err) { + if err != nil && ierrors.Is(err, ErrorSlotEvicted) { b.LogError("dropped block referencing unsolidifiable commitment", "commitmentID", block.ProtocolBlock().Header.SlotCommitmentID, "blockID", block.ID(), "err", err) return diff --git a/pkg/protocol/engine/ledger/ledger/ledger.go b/pkg/protocol/engine/ledger/ledger/ledger.go index df1d5216a..c281951ee 100644 --- a/pkg/protocol/engine/ledger/ledger/ledger.go +++ b/pkg/protocol/engine/ledger/ledger/ledger.go @@ -274,7 +274,7 @@ func (l *Ledger) OutputOrSpent(outputID iotago.OutputID) (*utxoledger.Output, *u stateRef := mempool.UTXOInputStateRefFromInput(outputID.UTXOInput()) stateWithMetadata, err := l.memPool.StateMetadata(stateRef) if err != nil { - if ierrors.Is(iotago.ErrInputAlreadySpent, err) { + if ierrors.Is(err, iotago.ErrInputAlreadySpent) { l.utxoLedger.ReadLockLedger() defer l.utxoLedger.ReadUnlockLedger()