|
|
|
@ -10,6 +10,7 @@ import ( |
|
|
|
|
"math/rand" |
|
|
|
|
"os" |
|
|
|
|
"path" |
|
|
|
|
"sync" |
|
|
|
|
"time" |
|
|
|
|
|
|
|
|
|
"github.com/ethereum/go-ethereum/common" |
|
|
|
@ -785,7 +786,12 @@ func FetchBalance(address common.Address) []*AccountState { |
|
|
|
|
result = append(result, nil) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var wg sync.WaitGroup |
|
|
|
|
wg.Add(walletProfile.Shards) |
|
|
|
|
|
|
|
|
|
for shardID := 0; shardID < walletProfile.Shards; shardID++ { |
|
|
|
|
go func(shardID int) { |
|
|
|
|
defer wg.Done() |
|
|
|
|
balance := big.NewInt(0) |
|
|
|
|
var nonce uint64 |
|
|
|
|
|
|
|
|
@ -818,7 +824,9 @@ func FetchBalance(address common.Address) []*AccountState { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
result[shardID] = &AccountState{balance, nonce} |
|
|
|
|
}(shardID) |
|
|
|
|
} |
|
|
|
|
wg.Wait() |
|
|
|
|
return result |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|