Skip to content
This repository has been archived by the owner on Jun 6, 2023. It is now read-only.

require success in reward actor send reward #331

Merged
merged 1 commit into from
Apr 28, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion actors/builtin/reward/reward_actor.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,11 @@ func (a Actor) AwardBlockReward(rt vmr.Runtime, params *AwardBlockRewardParams)
}).(abi.TokenAmount)

_, code := rt.Send(minerAddr, builtin.MethodsMiner.AddLockedFund, &rewardPayable, rewardPayable)
builtin.RequireSuccess(rt, code, "failed to send reward to miner: %s", minerAddr)

// Burn the penalty amount.
_, code = rt.Send(builtin.BurntFundsActorAddr, builtin.MethodSend, nil, penalty)
builtin.RequireSuccess(rt, code, "failed to send penalty to BurntFundsActor")
builtin.RequireSuccess(rt, code, "failed to send penalty to burnt funds actor")

return nil
}
Expand Down