Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
yzang2019 committed Apr 1, 2024
1 parent 286fed6 commit 59753b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/mempool/mempool.go
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,6 @@ func (txmp *TxMempool) canAddTx(wtx *WrappedTx) error {
}

func (txmp *TxMempool) insertTx(wtx *WrappedTx) {
txmp.metrics.InsertedTxs.Add(1)
txmp.txStore.SetTx(wtx)
txmp.priorityIndex.PushTx(wtx)
txmp.heightIndex.Insert(wtx)
Expand All @@ -809,6 +808,7 @@ func (txmp *TxMempool) insertTx(wtx *WrappedTx) {
gossipEl := txmp.gossipIndex.PushBack(wtx)
wtx.gossipEl = gossipEl

txmp.metrics.InsertedTxs.Add(1)
atomic.AddInt64(&txmp.sizeBytes, int64(wtx.Size()))
}

Expand All @@ -817,7 +817,6 @@ func (txmp *TxMempool) removeTx(wtx *WrappedTx, removeFromCache bool) {
return
}

txmp.metrics.RecheckTimes.Add(1)
txmp.txStore.RemoveTx(wtx)
txmp.priorityIndex.RemoveTx(wtx)
txmp.heightIndex.Remove(wtx)
Expand All @@ -828,6 +827,7 @@ func (txmp *TxMempool) removeTx(wtx *WrappedTx, removeFromCache bool) {
txmp.gossipIndex.Remove(wtx.gossipEl)
wtx.gossipEl.DetachPrev()

txmp.metrics.RemovedTxs.Add(1)
atomic.AddInt64(&txmp.sizeBytes, int64(-wtx.Size()))

if removeFromCache {
Expand Down

0 comments on commit 59753b7

Please sign in to comment.