Add a comment for commission_split()

This commit is contained in:
Ryo Onodera
2020-07-15 04:03:15 +09:00
parent 989b1b9117
commit 8929e44361

View File

@@ -259,6 +259,11 @@ impl VoteState {
100 => (on, 0, false),
split => {
let on = u128::from(on);
// Calculate mine and theirs independently and symmetrically instead of
// using the remainder of the other to treat them strictly equally.
// This is also to cancel the rewarding if either of the parties
// should receive only fractional lamports, resulting in not being rewarded at all.
// Thus, note that we intentionally discard any residual fractional lamports.
let mine = on * u128::from(split) / 100u128;
let theirs = on * u128::from(100 - split) / 100u128;