Fix prepare_registration dust

We could get a rounding error in the contributor spots that would make
the registration fail when passed to oxend.  This fixes it by restoring
the missing logic that was accidentally dropped in the
prepare_registration refactor.
This commit is contained in:
Jason Rhinelander 2022-04-19 22:45:49 -03:00
parent a91c491111
commit 711c7462c3
No known key found for this signature in database
GPG Key ID: C4992CE7A88D4262
1 changed files with 3 additions and 0 deletions

View File

@ -2215,6 +2215,9 @@ bool rpc_command_executor::prepare_registration(bool force_registration)
break;
}
if (portions > state.portions_remaining)
portions = state.portions_remaining;
state.contributions.push_back(portions);
state.portions_remaining -= portions;
state.total_reserved_contributions += get_actual_amount(staking_requirement, portions);