Skip to content

Commit

Permalink
Merge pull request #527 from iotaledger/fix/inx-listen-to-accepted-tx
Browse files Browse the repository at this point in the history
Fix incorrect handling of mempool.StateMetadata in ListenToAcceptedTransactions
  • Loading branch information
muXxer authored Nov 16, 2023
2 parents ccd9f5d + f9bf24f commit d7c7664
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions components/inx/server_utxo.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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)
Expand Down

0 comments on commit d7c7664

Please sign in to comment.