Fixed bookie payout
This commit is contained in:
parent
9cfd190fa1
commit
2428383466
1 changed files with 5 additions and 4 deletions
|
|
@ -264,11 +264,12 @@ void database::settle_betting_market_group(const betting_market_group_object& be
|
||||||
if (net_profits.value > 0 && rake_account_id)
|
if (net_profits.value > 0 && rake_account_id)
|
||||||
{
|
{
|
||||||
rake_amount = ((fc::uint128_t(net_profits.value) * rake_fee_percentage + GRAPHENE_100_PERCENT - 1) / GRAPHENE_100_PERCENT).to_uint64();
|
rake_amount = ((fc::uint128_t(net_profits.value) * rake_fee_percentage + GRAPHENE_100_PERCENT - 1) / GRAPHENE_100_PERCENT).to_uint64();
|
||||||
|
share_type affiliates_share;
|
||||||
if (rake_amount.value)
|
if (rake_amount.value)
|
||||||
rake_amount -= payout_helper.payout( bettor_id, rake_amount );
|
affiliates_share = payout_helper.payout( bettor_id, rake_amount );
|
||||||
FC_ASSERT( rake_amount.value >= 0 );
|
FC_ASSERT( rake_amount.value >= affiliates_share.value );
|
||||||
if (rake_amount.value)
|
if (rake_amount.value > affiliates_share.value)
|
||||||
adjust_balance(*rake_account_id, asset(rake_amount, betting_market_group.asset_id));
|
adjust_balance(*rake_account_id, asset(rake_amount - affiliates_share, betting_market_group.asset_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
// pay winning - rake
|
// pay winning - rake
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue