OSDN Git Service

fix for debug
authorpaladz <453256728@qq.com>
Wed, 18 Apr 2018 09:00:03 +0000 (17:00 +0800)
committerpaladz <453256728@qq.com>
Wed, 18 Apr 2018 09:00:03 +0000 (17:00 +0800)
account/image.go

index bf88a38..85c3ae7 100644 (file)
@@ -21,12 +21,15 @@ func (m *Manager) Backup() (*AccountImage, error) {
        defer accountIter.Release()
 
        for accountIter.Next() {
-               accountSlice := &AccountSlice{}
-               if err := json.Unmarshal(accountIter.Value(), accountSlice.Account); err != nil {
+               a := &Account{}
+               if err := json.Unmarshal(accountIter.Value(), a); err != nil {
                        return nil, err
                }
 
-               accountSlice.ContractIndex = m.getNextContractIndex(accountSlice.Account.ID)
+               accountSlice := &AccountSlice{
+                       Account:       a,
+                       ContractIndex: m.getNextContractIndex(a.ID),
+               }
                accountSlices = append(accountSlices, accountSlice)
        }