}
if ( remaining_price != 0 )
newunitprice = (remaining_nValue * COIN) / remaining_price;
- fprintf(stderr,"recvunitprice %.8f >= %.8f unitprice, new unitprice %.8f\n",(double)recvunitprice/COIN,(double)unitprice/COIN,(double)newunitprice/COIN);
+ fprintf(stderr,"recvunitprice %.16f >= %.16f unitprice, new unitprice %.16f\n",(double)recvunitprice/(COIN*COIN),(double)unitprice/(COIN*COIN),(double)newunitprice/(COIN*COIN));
}
return(true);
}
return(true);
}
remaining_price = (totalunits - paidunits);
- unitprice = (orig_nValue * COIN) / totalunits;
+ unitprice = (orig_nValue * COIN) / totalunits; // unit price has 10 decimals precision, eg. unitprice of 100 million is 1 COIN per unit
if ( unitprice > 0 && (received_nValue= (paidunits * unitprice)/COIN) > 0 && received_nValue < orig_nValue )
{
remaining_nValue = (orig_nValue - received_nValue);
else if ( AssetValidate(eval,ctx,n,funcid,assetid,assetid2,amount,origpubkey) != 0 )
{
//prevtxid = txid;
+ if ( funcid == 'B' )
+ return(false);
fprintf(stderr,"AssetValidate.(%c) passed\n",funcid);
return(true);
}
EvalRef eval;
bool out = eval->Dispatch(cond, tx, nIn);
+ fprintf(stderr,"out %d vs %d isValid\n",(int32_t)out,(int32_t)eval->state.IsValid());
assert(eval->state.IsValid() == out);
if (eval->state.IsValid()) return true;