We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bd7a7a8 commit 12a6af4Copy full SHA for 12a6af4
core/txpool/pending.go
@@ -137,7 +137,7 @@ func (ps *pendingSet) Clear() {
137
}
138
139
func (ps *pendingSet) Empty() bool {
140
- return len(ps.Heads) != 0
+ return len(ps.Heads) == 0
141
142
143
// Pop removes the best transaction, *not* replacing it with the next one from
core/txpool/pending_test.go
@@ -73,6 +73,9 @@ func TestPendingSortAndShift(t *testing.T) {
73
haveCount = 0
74
prevFee = uint64(math.MaxInt64)
75
)
76
+ if txset.Empty() {
77
+ t.Fatalf("expected non-empty")
78
+ }
79
for {
80
ltx, fee := txset.Peek()
81
if ltx == nil {
0 commit comments