From f58655b1cd2e3c5b8e61138a23d268aa285b6d8a Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 18 Mar 2019 08:40:47 -1100 Subject: [PATCH] Thresholding --- src/cc/cclib.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cc/cclib.cpp b/src/cc/cclib.cpp index c783eb4d0..25cd691c5 100644 --- a/src/cc/cclib.cpp +++ b/src/cc/cclib.cpp @@ -492,7 +492,9 @@ int64_t AddCClibInputs(struct CCcontract_info *cp,CMutableTransaction &mtx,CPubK std::vector > unspentOutputs; GetCCaddress(cp,coinaddr,pk); SetCCunspents(unspentOutputs,coinaddr); - threshold = total/(maxinputs+1); + if ( maxinputs != 0 ) + threshold = total/maxinputs; + else threshold = total; for (std::vector >::const_iterator it=unspentOutputs.begin(); it!=unspentOutputs.end(); it++) { txid = it->first.txhash;