OSDN Git Service

fix x86-32 exeception for 64-bit aligned
[bytom/bytom-spv.git] / account / reserve.go
index c0dfbe1..40ff3ba 100644 (file)
@@ -96,9 +96,11 @@ func newReserver(c *protocol.Chain, walletdb dbm.DB) *reserver {
 // reserver ensures idempotency of reservations until the reservation
 // expiration.
 type reserver struct {
+       // `sync/atomic` expects the first word in an allocated struct to be 64-bit
+       // aligned on both ARM and x86-32. See https://goo.gl/zW7dgq for more details.
+       nextReservationID uint64
        c                 *protocol.Chain
        db                dbm.DB
-       nextReservationID uint64
        idempotency       idempotency.Group
 
        reservationsMu sync.Mutex