mirror of
https://github.com/mimblewimble/grin.git
synced 2025-01-21 03:21:08 +03:00
Prevent reward overflow (#2372)
* Prevent reward overflow Without this, a miner could cause a crash by including a kernel with an insane fee directly in the block. * Plus and minus, not so similar * Can't be trusted with more code today
This commit is contained in:
parent
5d257283bd
commit
ba994248ac
1 changed files with 1 additions and 1 deletions
|
@ -43,7 +43,7 @@ pub const REWARD: u64 = BLOCK_TIME_SEC * GRIN_BASE;
|
|||
|
||||
/// Actual block reward for a given total fee amount
|
||||
pub fn reward(fee: u64) -> u64 {
|
||||
REWARD + fee
|
||||
REWARD.saturating_add(fee)
|
||||
}
|
||||
|
||||
/// Nominal height for standard time intervals, hour is 60 blocks
|
||||
|
|
Loading…
Reference in a new issue