Skip to content

Commit

Permalink
add test log6
Browse files Browse the repository at this point in the history
  • Loading branch information
mapdev33 committed Dec 16, 2023
1 parent 5cc8967 commit 9dd6f77
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions core/types/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,14 @@ type TransactionsByPriceAndNonce struct {
baseFee *big.Int // Current base fee
}

func getPendingCount(pending map[common.Address]Transactions) int {
count := 0
for _, txs := range pending {
count += len(txs)
}
return count
}

// NewTransactionsByPriceAndNonce creates a transaction set that can retrieve
// price sorted transactions in a nonce-honouring way.
//
Expand All @@ -524,12 +532,14 @@ func NewTransactionsByPriceAndNonce(signer Signer, txs map[common.Address]Transa
// Remove transaction if sender doesn't match from, or if wrapping fails.
if acc != from || err != nil {
delete(txs, from)
log.Error("NewTransactionsByPriceAndNonce", "err", err)
continue
}
heads = append(heads, wrapped)
txs[from] = accTxs[1:]
}
heap.Init(&heads)
log.Info("NewTransactionsByPriceAndNonce", "txs", getPendingCount(txs))
// Assemble and return the transaction set
return &TransactionsByPriceAndNonce{
txs: txs,
Expand Down

0 comments on commit 9dd6f77

Please sign in to comment.