Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lint: enable govet shadow linter and resolve linter warnings #5261

Merged
merged 10 commits into from
Jun 1, 2023
Prev Previous commit
Next Next commit
CR fixes and one comment
  • Loading branch information
cce committed May 30, 2023
commit 81c846134a31c051cd81019fe7ff7987f6973dda
3 changes: 1 addition & 2 deletions ledger/acctupdates.go
Original file line number Diff line number Diff line change
Expand Up @@ -1508,8 +1508,7 @@ func (au *accountUpdates) lookupWithoutRewards(rnd basics.Round, addr basics.Add
}

// getCreatorForRound returns the asset/app creator for a given asset/app index at a given round
func (au *accountUpdates) getCreatorForRound(rnd basics.Round, cidx basics.CreatableIndex, ctype basics.CreatableType, synchronized bool) (
/* creator */ basics.Address /* found */, bool, error) {
func (au *accountUpdates) getCreatorForRound(rnd basics.Round, cidx basics.CreatableIndex, ctype basics.CreatableType, synchronized bool) (basics.Address, bool, error) {
unlock := false
if synchronized {
au.accountsMu.RLock()
Expand Down
1 change: 1 addition & 0 deletions ledger/catchpointtracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -1066,6 +1066,7 @@ func (ct *catchpointTracker) accountsUpdateBalances(accountsDeltas compactAccoun
if ct.log.GetTelemetryEnabled() {
root, rootErr := ct.balancesTrie.RootHash()
if rootErr != nil {
// log rootErr if failed to fetch for reporting in telemetry, then return whether Commit() succeeded or not
ct.log.Errorf("accountsUpdateBalances: error retrieving balances trie root: %v", rootErr)
return commitErr
}
Expand Down
8 changes: 4 additions & 4 deletions ledger/catchupaccessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -603,9 +603,9 @@ func (c *catchpointCatchupAccessorImpl) processStagingBalances(ctx context.Conte
wg.Add(1)
go func() {
defer wg.Done()
writeBalStart := time.Now()
writeBalancesStart := time.Now()
errBalances = c.stagingWriter.writeBalances(ctx, normalizedAccountBalances)
durBalances = time.Since(writeBalStart)
durBalances = time.Since(writeBalancesStart)
}()

// on a in-memory database, wait for the writer to finish before starting the new writer
Expand All @@ -627,9 +627,9 @@ func (c *catchpointCatchupAccessorImpl) processStagingBalances(ctx context.Conte
}
}
if hasCreatables {
writeStart := time.Now()
writeCreatablesStart := time.Now()
errCreatables = c.stagingWriter.writeCreatables(ctx, normalizedAccountBalances)
durCreatables = time.Since(writeStart)
durCreatables = time.Since(writeCreatablesStart)
}
}()

Expand Down