diff --git a/vms/platformvm/txs/mempool/mempool.go b/vms/platformvm/txs/mempool/mempool.go index e7a2018b7e71..675ec3c5c763 100644 --- a/vms/platformvm/txs/mempool/mempool.go +++ b/vms/platformvm/txs/mempool/mempool.go @@ -192,6 +192,7 @@ func (m *mempool) Add(tx *txs.Tx) error { } m.unissuedTxs.Put(tx.ID(), tx) + m.numTxs.Inc() m.bytesAvailable -= txSize m.bytesAvailableMetric.Set(float64(m.bytesAvailable)) @@ -220,12 +221,11 @@ func (m *mempool) Remove(txsToRemove []*txs.Tx) { if !m.unissuedTxs.Delete(txID) { continue } + m.numTxs.Dec() m.bytesAvailable += len(tx.Bytes()) m.bytesAvailableMetric.Set(float64(m.bytesAvailable)) - m.numTxs.Dec() - inputs := tx.Unsigned.InputIDs() m.consumedUTXOs.Difference(inputs) }