From 2b6315fd1370a6a95d5e89e4c707500c2f51f6c0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Aug 2018 20:24:33 -1100 Subject: [PATCH] Fix utxo selection --- src/cc/CCtx.cpp | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/src/cc/CCtx.cpp b/src/cc/CCtx.cpp index a22b4fd7d..65adc6655 100644 --- a/src/cc/CCtx.cpp +++ b/src/cc/CCtx.cpp @@ -266,16 +266,22 @@ int64_t AddNormalinputs(CMutableTransaction &mtx,CPubKey mypk,int64_t total,int3 { txid = out.tx->GetHash(); vout = out.i; - for (i=0; i 0 ) + { + for (i=0; i 0 ) + { + for (i=0; itxid,up->vout,CScript())); totalinputs += up->nValue; remains -= up->nValue; + utxos[ind] = utxos[--n]; + memset(&utxos[n],0,sizeof(utxos[n])); if ( totalinputs >= total || (i+1) >= maxinputs ) break; }