Skip to content

Commit

Permalink
Fix bug in tx_list (ethereum#323)
Browse files Browse the repository at this point in the history
  • Loading branch information
Asa Oines authored Jul 9, 2019
1 parent 11eeabc commit 6f22f7b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions core/tx_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -564,8 +564,13 @@ func (l *txPricedList) Discard(count int, local *accountSet) types.Transactions
// Retrieves the heap with the lowest normalized price at it's head
func (l *txPricedList) getHeapWithMinHead() (*priceHeap, *types.Transaction) {
// Initialize it to the nilCurrencyHeap
var cheapestHeap *priceHeap = l.nilCurrencyHeap
var cheapestTxn *types.Transaction = []*types.Transaction(*l.nilCurrencyHeap)[0]
var cheapestHeap *priceHeap
var cheapestTxn *types.Transaction

if len(*l.nilCurrencyHeap) > 0 {
cheapestHeap = l.nilCurrencyHeap
cheapestTxn = []*types.Transaction(*l.nilCurrencyHeap)[0]
}

for _, priceHeap := range l.nonNilCurrencyHeaps {
if len(*priceHeap) > 0 {
Expand Down

0 comments on commit 6f22f7b

Please sign in to comment.