more changes
This commit is contained in:
parent
d3ffefbe2d
commit
77baa30496
1 changed files with 8 additions and 0 deletions
|
|
@ -99,6 +99,14 @@ namespace graphene { namespace chain {
|
|||
if( a.asset_id == b.base.asset_id )
|
||||
{
|
||||
FC_ASSERT( b.base.amount.value > 0 );
|
||||
uint128_t result = (uint128_t(a.amount.value) * b.quote.amount.value + b.base.amount.value - 1)/b.base.amount.value;
|
||||
FC_ASSERT( result <= GRAPHENE_MAX_SHARE_SUPPLY );
|
||||
return asset( result.convert_to<int64_t>(), b.quote.asset_id );
|
||||
}
|
||||
else if( a.asset_id == b.quote.asset_id )
|
||||
{
|
||||
FC_ASSERT( b.quote.amount.value > 0 );
|
||||
uint128_t result = (uint128_t(a.amount.value) * b.base.amount.value + b.quote.amount.value - 1)/b.quote.amount.value;
|
||||
FC_ASSERT( result <= GRAPHENE_MAX_SHARE_SUPPLY );
|
||||
return asset( result.convert_to<int64_t>(), b.base.asset_id );
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue