Skip to content

Commit

Permalink
Save rewards only if miner exists in the network
Browse files Browse the repository at this point in the history
  • Loading branch information
lpoli committed May 2, 2023
1 parent afbbb96 commit d35cec9
Showing 1 changed file with 6 additions and 4 deletions.
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

0 comments on commit d35cec9

Please sign in to comment.