OSDN Git Service

fix key import progress
authorYongfeng LI <wliyongfeng@gmail.com>
Wed, 4 Apr 2018 06:34:34 +0000 (14:34 +0800)
committerYongfeng LI <wliyongfeng@gmail.com>
Wed, 4 Apr 2018 06:34:34 +0000 (14:34 +0800)
wallet/wallet.go

index 0f08a08..3bed7c9 100755 (executable)
@@ -337,14 +337,14 @@ func (w *Wallet) GetRescanStatus() ([]KeyInfo, error) {
                }
        }
 
-       for i, v := range keysInfo {
-               if v.Complete == true || status.BestHeight == 0 {
+       for i := range keysInfo {
+               if keysInfo[i].Complete == true || status.BestHeight == 0 {
                        keysInfo[i].Percent = 100
                        continue
                }
 
                keysInfo[i].Percent = uint8(status.WorkHeight * 100 / status.BestHeight)
-               if v.Percent == 100 {
+               if keysInfo[i].Percent == 100 {
                        keysInfo[i].Complete = true
                }
        }