1
0
Fork 0

fix lock value copy bug

This commit is contained in:
Massaki Archambault 2021-12-24 15:58:38 -05:00
parent 44fab9eab5
commit a0430b6c1e
1 changed files with 8 additions and 2 deletions

View File

@ -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{},
}
}