From f9bf24fa0ecb3d79c1b74c52963a8c820857b4ef Mon Sep 17 00:00:00 2001 From: muXxer Date: Thu, 16 Nov 2023 14:33:57 +0100 Subject: [PATCH] Fix incorrect handling of mempool.StateMetadata in ListenToAcceptedTransactions --- components/inx/server_utxo.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/components/inx/server_utxo.go b/components/inx/server_utxo.go index bc11ae9e0..4868e5859 100644 --- a/components/inx/server_utxo.go +++ b/components/inx/server_utxo.go @@ -353,7 +353,8 @@ func (s *Server) ListenToAcceptedTransactions(_ *inx.NoParams, srv inx.INX_Liste if err := transactionMetadata.Inputs().ForEach(func(stateMetadata mempool.StateMetadata) error { spentOutput, ok := stateMetadata.State().(*utxoledger.Output) if !ok { - return ierrors.Errorf("unexpected state metadata type: %T", stateMetadata.State()) + // not an Output, so we don't need to send it (could be MockedState, Commitment, BlockIssuanceCreditInput, RewardInput, etc.) + return nil } inxSpent, err := NewLedgerSpent(utxoledger.NewSpent(spentOutput, transactionMetadata.ID(), slot)) @@ -372,7 +373,8 @@ func (s *Server) ListenToAcceptedTransactions(_ *inx.NoParams, srv inx.INX_Liste if err := transactionMetadata.Outputs().ForEach(func(stateMetadata mempool.StateMetadata) error { output, ok := stateMetadata.State().(*utxoledger.Output) if !ok { - return ierrors.Errorf("unexpected state metadata type: %T", stateMetadata.State()) + // not an Output, so we don't need to send it (could be MockedState, Commitment, BlockIssuanceCreditInput, RewardInput, etc.) + return nil } inxOutput, err := NewLedgerOutput(output)