Skip to content

Commit

Permalink
fix: shadows
Browse files Browse the repository at this point in the history
  • Loading branch information
icorderi committed Jun 2, 2023
1 parent 52c7ca7 commit e53c6ca
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
3 changes: 2 additions & 1 deletion ledger/store/trackerdb/generickv/accounts_ext_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ func (w *accountsWriter) OnlineAccountsDelete(forgetBefore basics.Round) (err er

// delete on voting empty
var oad trackerdb.BaseOnlineAccountData
data, err := iter.Value()
var data []byte
data, err = iter.Value()
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion ledger/store/trackerdb/generickv/migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ func (m *migrator) initialVersion(ctx context.Context) error {
baseOnlineAD.MicroAlgos = bad.MicroAlgos
baseOnlineAD.RewardsBase = bad.RewardsBase

_, err := oaow.InsertOnlineAccount(addr, account.NormalizedOnlineBalance(proto), baseOnlineAD, uint64(updRound), uint64(baseOnlineAD.VoteLastValid))
_, err = oaow.InsertOnlineAccount(addr, account.NormalizedOnlineBalance(proto), baseOnlineAD, uint64(updRound), uint64(baseOnlineAD.VoteLastValid))
if err != nil {
return err
}
Expand Down
3 changes: 2 additions & 1 deletion ledger/trackerdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ func trackerDBInitialize(l ledgerForTracker, catchpointEnabled bool, dbPathPrefi
if lastBalancesRound > lastestBlockRound {
log.Warnf("trackerDBInitialize: resetting accounts DB (on round %v, but blocks DB's latest is %v)", lastBalancesRound, lastestBlockRound)
err = dbs.Transaction(func(ctx context.Context, tx trackerdb.TransactionScope) error {
aw, err := tx.MakeAccountsWriter()
var aw trackerdb.AccountsWriterExt
aw, err = tx.MakeAccountsWriter()
if err != nil {
return err
}
Expand Down
10 changes: 5 additions & 5 deletions tools/debug/transplanter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,18 +212,18 @@ func transcribeSnappyLog(filePath string, output chan txGroupItem, wg *sync.Wait
}
defer file.Close()

var headerDecoder headerDecoder
var hd headerDecoder
if strings.Contains(path.Base(filePath), "_v2") {
headerDecoder = decoderV2{}
hd = decoderV2{}
} else {
headerDecoder = decoderV1{}
hd = decoderV1{}
}

snappyReader := snappy.NewReader(file)
var n int

for {
headers, lenMsg, err := headerDecoder.decodeHeader(snappyReader)
headers, lenMsg, err := hd.decodeHeader(snappyReader)
if err == io.EOF {
break
} else if err != nil {
Expand Down Expand Up @@ -395,7 +395,7 @@ func main() {
os.Exit(1)
}
syncRound := uint64(*roundStart) - cfg.MaxAcctLookback + 1
err := followerNode.SetSyncRound(syncRound)
err = followerNode.SetSyncRound(syncRound)
if err != nil {
fmt.Fprintf(os.Stderr, "Cannot configure catchup: %v", err)
os.Exit(1)
Expand Down

0 comments on commit e53c6ca

Please sign in to comment.