diff --git a/CHANGELOG.md b/CHANGELOG.md index bd1c7fe6b..a38363ad8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## v3.11.0 +Fri Dec 15 12:59:23 CST 2023 + +- prioritize transfer tx in tx pool + ## v3.10.1 Tue Aug 22 21:03:12 CST 2023 diff --git a/core/txpool/tx_pool.go b/core/txpool/tx_pool.go index 46ee6e8c4..9aa356c61 100644 --- a/core/txpool/tx_pool.go +++ b/core/txpool/tx_pool.go @@ -148,8 +148,15 @@ func (pool *TxPImpl) initBlockTx() { } func (pool *TxPImpl) verifyTx(t *tx.Tx) error { - if pool.pendingTx.Size() > maxCacheTxs { - return ErrCacheFull + isSimpleTransfer := len(t.Actions) == 1 && t.Actions[0].Contract == "token.iost" + if isSimpleTransfer { + if pool.pendingTx.Size() > 2*maxCacheTxs { + return ErrCacheFull + } + } else { + if pool.pendingTx.Size() > maxCacheTxs { + return ErrCacheFull + } } // Add one second delay for tx created time check currentTime := time.Now().UnixNano()