mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Make fine multiplicators rational with 256 base
This commit is contained in:
parent
41255daa54
commit
46204d918d
2 changed files with 9 additions and 9 deletions
|
@ -3722,18 +3722,18 @@ bool compute_punishment(int interval, bool severe, td::RefInt256& fine, unsigned
|
|||
fine_part = rec.default_proportional_fine;
|
||||
|
||||
if (severe) {
|
||||
fine = fine * rec.severity_flat_mult;
|
||||
fine_part = fine_part * rec.severity_proportional_mult;
|
||||
fine = fine * rec.severity_flat_mult; fine >>= 8;
|
||||
fine_part = fine_part * rec.severity_proportional_mult; fine_part >>= 8;
|
||||
}
|
||||
|
||||
if (interval >= rec.long_interval) {
|
||||
fine = fine * rec.long_flat_mult;
|
||||
fine_part = fine_part * rec.long_proportional_mult;
|
||||
fine = fine * rec.long_flat_mult; fine >>= 8;
|
||||
fine_part = fine_part * rec.long_proportional_mult; fine_part >>= 8;
|
||||
return true;
|
||||
}
|
||||
if (interval >= rec.medium_interval) {
|
||||
fine = fine * rec.medium_flat_mult;
|
||||
fine_part = fine_part * rec.medium_proportional_mult;
|
||||
fine = fine * rec.medium_flat_mult; fine >>= 8;
|
||||
fine_part = fine_part * rec.medium_proportional_mult; fine_part >>= 8;
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue