Merge branch 'jl777' into FSM
This commit is contained in:
@@ -58,16 +58,20 @@ bool ValidateBidRemainder(int64_t remaining_units,int64_t remaining_nValue,int64
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
unitprice = (orig_nValue * COIN) / totalunits;
|
//unitprice = (orig_nValue * COIN) / totalunits;
|
||||||
recvunitprice = (received_nValue * COIN) / paidunits;
|
//recvunitprice = (received_nValue * COIN) / paidunits;
|
||||||
|
//if ( remaining_units != 0 )
|
||||||
|
// newunitprice = (remaining_nValue * COIN) / remaining_units;
|
||||||
|
unitprice = (orig_nValue / totalunits);
|
||||||
|
recvunitprice = (received_nValue / paidunits);
|
||||||
if ( remaining_units != 0 )
|
if ( remaining_units != 0 )
|
||||||
newunitprice = (remaining_nValue * COIN) / remaining_units;
|
newunitprice = (remaining_nValue / remaining_units);
|
||||||
if ( recvunitprice < unitprice )
|
if ( recvunitprice < unitprice )
|
||||||
{
|
{
|
||||||
fprintf(stderr,"error recvunitprice %.16f < %.16f unitprice, new unitprice %.16f\n",(double)recvunitprice/(COIN*COIN),(double)unitprice/(COIN*COIN),(double)newunitprice/(COIN*COIN));
|
fprintf(stderr,"error recvunitprice %.16f < %.16f unitprice, new unitprice %.16f\n",(double)recvunitprice/(COIN),(double)unitprice/(COIN),(double)newunitprice/(COIN));
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
fprintf(stderr,"orig %llu total %llu, recv %llu paid %llu,recvunitprice %.16f >= %.16f unitprice, new unitprice %.16f\n",(long long)orig_nValue,(long long)totalunits,(long long)received_nValue,(long long)paidunits,(double)recvunitprice/(COIN*COIN),(double)unitprice/(COIN*COIN),(double)newunitprice/(COIN*COIN));
|
fprintf(stderr,"orig %llu total %llu, recv %llu paid %llu,recvunitprice %.16f >= %.16f unitprice, new unitprice %.16f\n",(long long)orig_nValue,(long long)totalunits,(long long)received_nValue,(long long)paidunits,(double)recvunitprice/(COIN),(double)unitprice/(COIN),(double)newunitprice/(COIN));
|
||||||
}
|
}
|
||||||
return(true);
|
return(true);
|
||||||
}
|
}
|
||||||
@@ -89,8 +93,10 @@ bool SetBidFillamounts(int64_t &received_nValue,int64_t &remaining_units,int64_t
|
|||||||
return(true);
|
return(true);
|
||||||
}
|
}
|
||||||
remaining_units = (totalunits - paidunits);
|
remaining_units = (totalunits - paidunits);
|
||||||
unitprice = (orig_nValue * COIN) / totalunits;
|
//unitprice = (orig_nValue * COIN) / totalunits;
|
||||||
received_nValue = (paidunits * unitprice) / COIN;
|
//received_nValue = (paidunits * unitprice) / COIN;
|
||||||
|
unitprice = (orig_nValue / totalunits);
|
||||||
|
received_nValue = (paidunits * unitprice);
|
||||||
if ( unitprice > 0 && received_nValue > 0 && received_nValue <= orig_nValue )
|
if ( unitprice > 0 && received_nValue > 0 && received_nValue <= orig_nValue )
|
||||||
{
|
{
|
||||||
remaining_nValue = (orig_nValue - received_nValue);
|
remaining_nValue = (orig_nValue - received_nValue);
|
||||||
|
|||||||
Reference in New Issue
Block a user