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;