From bba1ef17b8721a121bb80d5e496b346fffd3570b Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Jul 2018 13:52:46 -1100 Subject: [PATCH] Test --- src/cc/CCassetsCore.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cc/CCassetsCore.cpp b/src/cc/CCassetsCore.cpp index ecb37e02d..5c155e520 100644 --- a/src/cc/CCassetsCore.cpp +++ b/src/cc/CCassetsCore.cpp @@ -171,9 +171,11 @@ uint64_t IsAssetvout(uint64_t &price,std::vector &origpubkey,const CTra return(0); } -bool ValidateAssetRemainder(uint64_t remaining_price,uint64_t remaining_nValue,uint64_t orig_nValue,uint64_t received,uint64_t paid,uint64_t totalprice) +bool ValidateAssetRemainder(int64_t remaining_price,int64_t remaining_nValue,int64_t orig_nValue,int64_t received,int64_t paid,int64_t totalprice) { uint64_t price,recvprice; + if ( received >= totalprice ) + received = totalprice; if ( orig_nValue == 0 || received == 0 || paid == 0 || totalprice == 0 ) { fprintf(stderr,"ValidateAssetRemainder: orig_nValue == %llu || received == %llu || paid == %llu || totalprice == %llu\n",(long long)orig_nValue,(long long)received,(long long)paid,(long long)totalprice);