mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-03 23:02:55 +00:00
core: make txPricedList.stales the first field for 64bit alignment (#23542)
This fixes crashes on 32bit builds.
This commit is contained in:
parent
6ef3a16869
commit
51ed39c093
1 changed files with 6 additions and 1 deletions
|
|
@ -480,9 +480,14 @@ func (h *priceHeap) Pop() interface{} {
|
||||||
// better candidates for inclusion while in other cases (at the top of the baseFee peak)
|
// better candidates for inclusion while in other cases (at the top of the baseFee peak)
|
||||||
// the floating heap is better. When baseFee is decreasing they behave similarly.
|
// the floating heap is better. When baseFee is decreasing they behave similarly.
|
||||||
type txPricedList struct {
|
type txPricedList struct {
|
||||||
|
// Number of stale price points to (re-heap trigger).
|
||||||
|
// This field is accessed atomically, and must be the first field
|
||||||
|
// to ensure it has correct alignment for atomic.AddInt64.
|
||||||
|
// See https://golang.org/pkg/sync/atomic/#pkg-note-BUG.
|
||||||
|
stales int64
|
||||||
|
|
||||||
all *txLookup // Pointer to the map of all transactions
|
all *txLookup // Pointer to the map of all transactions
|
||||||
urgent, floating priceHeap // Heaps of prices of all the stored **remote** transactions
|
urgent, floating priceHeap // Heaps of prices of all the stored **remote** transactions
|
||||||
stales int64 // Number of stale price points to (re-heap trigger)
|
|
||||||
reheapMu sync.Mutex // Mutex asserts that only one routine is reheaping the list
|
reheapMu sync.Mutex // Mutex asserts that only one routine is reheaping the list
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue