File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ type BaseAccount struct {
70
70
// synced indicates whether the account has loaded and finished the initial sync of the
71
71
// addresses.
72
72
synced atomic.Bool
73
- offline error
73
+ offline atomic. Pointer [ error ]
74
74
75
75
// notes handles transaction notes.
76
76
notes * notes.Notes
@@ -128,13 +128,17 @@ func (account *BaseAccount) ResetSynced() {
128
128
129
129
// Offline implements Interface.
130
130
func (account * BaseAccount ) Offline () error {
131
- return account .offline
131
+ errorPtr := account .offline .Load ()
132
+ if errorPtr == nil {
133
+ return nil
134
+ }
135
+ return * errorPtr
132
136
}
133
137
134
138
// SetOffline sets the account offline status and emits the EventStatusChanged() if the status
135
139
// changed.
136
140
func (account * BaseAccount ) SetOffline (offline error ) {
137
- account .offline = offline
141
+ account .offline . Store ( & offline )
138
142
account .Notify (observable.Event {
139
143
Subject : string (types .EventStatusChanged ),
140
144
Action : action .Reload ,
You can’t perform that action at this time.
0 commit comments