fix lock value copy bug
This commit is contained in:
parent
44fab9eab5
commit
a0430b6c1e
10
exporter.go
10
exporter.go
|
@ -45,11 +45,12 @@ func NewExporter(accountAddress []string) (*Exporter, error) {
|
|||
// Account represents a helium account
|
||||
type Account struct {
|
||||
Address string
|
||||
UpdateLock sync.Mutex
|
||||
LastUpdate time.Time
|
||||
RewardsTotal map[string]int
|
||||
Tx AccountTx
|
||||
Hotspots map[string]Hotspot
|
||||
|
||||
UpdateLock *sync.Mutex
|
||||
}
|
||||
|
||||
func NewAccount(address string) Account {
|
||||
|
@ -67,6 +68,8 @@ func NewAccount(address string) Account {
|
|||
WithdrawalTotal: 0,
|
||||
},
|
||||
Hotspots: map[string]Hotspot{},
|
||||
|
||||
UpdateLock: &sync.Mutex{},
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -78,9 +81,10 @@ type AccountTx struct {
|
|||
// Hotspot represents a hotspot
|
||||
type Hotspot struct {
|
||||
Address string
|
||||
UpdateLock sync.Mutex
|
||||
LastUpdate time.Time
|
||||
RewardsTotal map[string]int
|
||||
|
||||
UpdateLock *sync.Mutex
|
||||
}
|
||||
|
||||
func NewHotspot(address string) Hotspot {
|
||||
|
@ -93,6 +97,8 @@ func NewHotspot(address string) Hotspot {
|
|||
"poc_challengees": 0,
|
||||
"poc_witnesses": 0,
|
||||
},
|
||||
|
||||
UpdateLock: &sync.Mutex{},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Reference in New Issue