diff --git a/src/cc/CCassetsCore.cpp b/src/cc/CCassetsCore.cpp index 2321eee09..e129adaf9 100644 --- a/src/cc/CCassetsCore.cpp +++ b/src/cc/CCassetsCore.cpp @@ -67,7 +67,7 @@ bool ValidateAssetRemainder(uint64_t remaining_price,uint64_t remaining_nValue,u } if ( remaining_price != 0 ) newunitprice = (remaining_nValue * COIN) / remaining_price; - fprintf(stderr,"recvunitprice %llu >= %llu unitprice, new unitprice %llu\n",(long long)recvunitprice,(long long)unitprice,(long long)newunitprice); + fprintf(stderr,"recvunitprice %.8f >= %.8f unitprice, new unitprice %llu\n",(double)recvunitprice/COIN,(double)unitprice/COIN,(double)newunitprice/COIN); } return(true); } @@ -94,7 +94,7 @@ bool SetAssetFillamounts(uint64_t &received_nValue,uint64_t &remaining_price,uin } remaining_price = (totalprice - paidprice); unitprice = (orig_nValue * COIN) / totalprice; - if ( unitprice > 0 && (received_nValue= paidprice * unitprice) > 0 && received_nValue < orig_nValue ) + if ( unitprice > 0 && (received_nValue= (paidprice * unitprice)/COIN) > 0 && received_nValue < orig_nValue ) { remaining_nValue = (orig_nValue - received_nValue); return(ValidateAssetRemainder(remaining_price,remaining_nValue,orig_nValue,received_nValue,paidprice,totalprice)); diff --git a/src/cc/assets.cpp b/src/cc/assets.cpp index f5c1a8ebf..7ddeaeea1 100644 --- a/src/cc/assets.cpp +++ b/src/cc/assets.cpp @@ -310,11 +310,11 @@ bool AssetValidate(Eval* eval,const CTransaction &tx,int32_t numvouts,uint8_t fu bool ProcessAssets(Eval* eval, std::vector paramsNull,const CTransaction &ctx, unsigned int nIn) { - static uint256 zero,prevtxid; - CTransaction createTx; uint256 txid,assetid,assetid2,hashBlock; uint8_t funcid; int32_t i,n; uint64_t amount; std::vector origpubkey; - txid = ctx.GetHash(); - if ( txid == prevtxid ) - return(true); + //static uint256 zero,prevtxid; + CTransaction createTx; uint256 assetid,assetid2,hashBlock; uint8_t funcid; int32_t i,n; uint64_t amount; std::vector origpubkey; + //txid = ctx.GetHash(); + //if ( txid == prevtxid ) + // return(true); fprintf(stderr,"ProcessAssets\n"); if ( paramsNull.size() != 0 ) // Don't expect params return eval->Invalid("Cannot have params"); @@ -328,11 +328,11 @@ bool ProcessAssets(Eval* eval, std::vector paramsNull,const CTransactio return eval->Invalid("cant find asset2 create txid"); else if ( AssetValidate(eval,ctx,n,funcid,assetid,assetid2,amount,origpubkey) != 0 ) { - prevtxid = txid; - fprintf(stderr,"AssetValidate passed\n"); + //prevtxid = txid; + fprintf(stderr,"AssetValidate.(%c) passed\n",funcid); return(true); } - fprintf(stderr,"AssetValidate failed\n"); + fprintf(stderr,"AssetValidate.(%c) failed\n",funcid); return(false); }