From 8db702933716ea8158ebda749a0e5dbbc48af95b Mon Sep 17 00:00:00 2001 From: Joshua Kim <20001595+joshua-kim@users.noreply.github.com> Date: Fri, 22 Dec 2023 04:30:09 -0500 Subject: [PATCH] nit Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com> --- vms/platformvm/vm.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/vms/platformvm/vm.go b/vms/platformvm/vm.go index 97b0cb7319b9..0e46720d05f0 100644 --- a/vms/platformvm/vm.go +++ b/vms/platformvm/vm.go @@ -5,6 +5,7 @@ package platformvm import ( "context" + "errors" "fmt" "net/http" @@ -487,6 +488,14 @@ func (vm *VM) GetBlockIDAtHeight(_ context.Context, height uint64) (ids.ID, erro // Invariant: tx should not be referenced again without the context lock // held to avoid any data races. func (vm *VM) issueTx(ctx context.Context, tx *txs.Tx) error { - //TODO check duplicate tx error - return vm.Network.IssueTx(ctx, tx) + err := vm.Network.IssueTx(ctx, tx) + if err != nil && !errors.Is(err, mempool.ErrDuplicateTx) { + vm.ctx.Log.Debug("failed to add tx to mempool", + zap.Stringer("txID", tx.ID()), + zap.Error(err), + ) + return err + } + + return nil }