()
| 121 | } |
| 122 | |
| 123 | func (this *ClientImpl) load() error { |
| 124 | err := this.walletData.Load(this.path) |
| 125 | if err != nil { |
| 126 | return fmt.Errorf("error loading wallet %s: %s", this.path, err) |
| 127 | } |
| 128 | for _, accData := range this.walletData.Accounts { |
| 129 | this.accAddrs[accData.Address] = accData |
| 130 | if accData.Label != "" { |
| 131 | this.accLabels[accData.Label] = accData |
| 132 | } |
| 133 | if accData.IsDefault { |
| 134 | this.defaultAcc = accData |
| 135 | } |
| 136 | } |
| 137 | return nil |
| 138 | } |
| 139 | |
| 140 | func (this *ClientImpl) save() error { |
| 141 | return this.walletData.Save(this.path) |
no test coverage detected