Test
This commit is contained in:
@@ -629,7 +629,7 @@ Value paxdeposit(const Array& params, bool fHelp)
|
|||||||
CBitcoinAddress address(params[0].get_str());
|
CBitcoinAddress address(params[0].get_str());
|
||||||
if (!address.IsValid())
|
if (!address.IsValid())
|
||||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Bitcoin address");
|
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Bitcoin address");
|
||||||
int32_t baseid,errflag = 0; int64_t netliability,minval,maxallowed,fiatoshis = atof(params[1].get_str().c_str()) * COIN;
|
int32_t baseid,errflag = 0; int64_t netliability,maxval,maxallowed,fiatoshis = atof(params[1].get_str().c_str()) * COIN;
|
||||||
std::string base = params[2].get_str();
|
std::string base = params[2].get_str();
|
||||||
std::string dest;
|
std::string dest;
|
||||||
height = chainActive.Tip()->nHeight;
|
height = chainActive.Tip()->nHeight;
|
||||||
@@ -638,13 +638,18 @@ Value paxdeposit(const Array& params, bool fHelp)
|
|||||||
errflag = 1;
|
errflag = 1;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
minval = approved;
|
maxval = approved;
|
||||||
if ( withdrawn < minval )
|
if ( withdrawn > maxval )
|
||||||
minval = withdrawn;
|
maxval = withdrawn;
|
||||||
netliability = (deposited - minval);
|
if ( redeemed > maxval )
|
||||||
|
maxval = redeemed;
|
||||||
|
netliability = (deposited - maxval);
|
||||||
maxallowed = komodo_maxallowed(baseid);
|
maxallowed = komodo_maxallowed(baseid);
|
||||||
if ( fiatoshis > (maxallowed - netliability) )
|
if ( fiatoshis > netliability )
|
||||||
|
{
|
||||||
|
fprintf(stderr,"fiatoshis %llu > (max %llu - net %llu)\n",(long long)fiatoshis,(long long)maxallowed,(long long)netliability);
|
||||||
errflag = 1;
|
errflag = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ( errflag != 0 )
|
if ( errflag != 0 )
|
||||||
throw runtime_error("paxdeposit not enough available inventory");
|
throw runtime_error("paxdeposit not enough available inventory");
|
||||||
|
|||||||
Reference in New Issue
Block a user