fix travis by adding comment for constant

pull/960/head
Minh Doan 6 years ago committed by Minh Doan
parent 1f0b192408
commit c4115cb47a
  1. 3
      node/node.go

@ -49,6 +49,7 @@ const (
) )
const ( const (
// TxPoolLimit is the limit of transaction pool.
TxPoolLimit = 20000 TxPoolLimit = 20000
) )
@ -229,7 +230,7 @@ func (node *Node) addPendingTransactions(newTxs types.Transactions) {
node.pendingTransactions = append(node.pendingTransactions, newTxs...) node.pendingTransactions = append(node.pendingTransactions, newTxs...)
// If length of pendingTransactions is greater than TxPoolLimit then by greedy take the TxPoolLimit recent transactions. // If length of pendingTransactions is greater than TxPoolLimit then by greedy take the TxPoolLimit recent transactions.
if len(node.pendingTransactions) > TxPoolLimit { if len(node.pendingTransactions) > TxPoolLimit {
utils.GetLogInstance().Error("Got more transactions than expected and this could caused OOM", "num", len(newTxs), "totalPending", len(node.pendingTransactions)) utils.GetLogInstance().Warn("Got more transactions than expected and this could caused OOM", "num", len(newTxs), "totalPending", len(node.pendingTransactions))
curLen := len(node.pendingTransactions) curLen := len(node.pendingTransactions)
node.pendingTransactions = node.pendingTransactions[curLen-TxPoolLimit:] node.pendingTransactions = node.pendingTransactions[curLen-TxPoolLimit:]
} }

Loading…
Cancel
Save