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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save rewards only if miner exists in the network #2358

Merged
merged 1 commit into from May 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 6 additions & 4 deletions code/go/0chain.net/smartcontract/minersc/fees.go
Expand Up @@ -380,10 +380,12 @@ func (msc *MinerSmartContract) payFees(t *transaction.Transaction,
logging.Logger.Info("pay_fee could not find sharder to reward", zap.Int64("round", b.Round))
}

// save node first, for the VC pools work
if err = mn.save(balances); err != nil {
return "", common.NewErrorf("pay_fees",
"saving generator node: %v", err)
if mn != nil {
// save node first, for the VC pools work
if err = mn.save(balances); err != nil {
return "", common.NewErrorf("pay_fees",
"saving generator node: %v", err)
}
}

if gn.RewardRoundFrequency != 0 && b.Round%gn.RewardRoundFrequency == 0 {
Expand Down