From 50dfc2240371a716226470316b3ba99475872c83 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 12 Sep 2018 00:39:43 -1100 Subject: [PATCH 01/14] Baton for data from mempool --- src/cc/oracles.cpp | 21 +++++++++++++++++++-- src/cc/rewards.cpp | 2 +- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/cc/oracles.cpp b/src/cc/oracles.cpp index 506605248..442da7a30 100644 --- a/src/cc/oracles.cpp +++ b/src/cc/oracles.cpp @@ -235,6 +235,21 @@ int64_t OracleDatafee(CScript &scriptPubKey,uint256 oracletxid,CPubKey publisher return(datafee); } +static uint256 myIs_baton_spentinmempool(uint256 batontxid,int32_t batonvout) +{ + BOOST_FOREACH(const CTxMemPoolEntry &e,mempool.mapTx) + { + const CTransaction &tx = e.GetTx(); + if ( tx.vout.size() > 0 && tx.vin.size() > 1 && batontxid == tx.vin[1].prevout.hash && batonvout == tx.vin[1].prevout.n ) + { + const uint256 &hash = tx.GetHash(); + char str[65]; fprintf(stderr,"found baton spent in mempool %s\n",uint256_str(str,txid)); + return(txid); + } + } + return(batontxid); +} + uint256 OracleBatonUtxo(uint64_t txfee,struct CCcontract_info *cp,uint256 reforacletxid,char *batonaddr,CPubKey publisher,std::vector &dataarg) { uint256 txid,oracletxid,hashBlock,btxid,batontxid = zeroid; int64_t dfee; int32_t dheight=0,vout,height,numvouts; CTransaction tx; CPubKey pk; uint8_t *ptr; std::vector vopret,data; @@ -273,6 +288,8 @@ uint256 OracleBatonUtxo(uint64_t txfee,struct CCcontract_info *cp,uint256 refora } } } + while ( myIsutxo_spentinmempool(batontxid,1) != 0 ) + batontxid = myIs_baton_spentinmempool(batontxid,1); return(batontxid); } @@ -284,11 +301,11 @@ uint256 OraclesBatontxid(uint256 reforacletxid,CPubKey refpk) cp = CCinit(&C,EVAL_ORACLES); CCtxidaddr(markeraddr,reforacletxid); SetCCunspents(unspentOutputs,markeraddr); - char str[67]; fprintf(stderr,"markeraddr.(%s) %s\n",markeraddr,pubkey33_str(str,(uint8_t *)&refpk)); + //char str[67]; fprintf(stderr,"markeraddr.(%s) %s\n",markeraddr,pubkey33_str(str,(uint8_t *)&refpk)); for (std::vector >::const_iterator it=unspentOutputs.begin(); it!=unspentOutputs.end(); it++) { txid = it->first.txhash; - fprintf(stderr,"check %s\n",uint256_str(str,txid)); + //fprintf(stderr,"check %s\n",uint256_str(str,txid)); height = (int32_t)it->second.blockHeight; if ( myGetTransaction(txid,regtx,hash) != 0 ) { diff --git a/src/cc/rewards.cpp b/src/cc/rewards.cpp index 61f10418c..a70071af9 100644 --- a/src/cc/rewards.cpp +++ b/src/cc/rewards.cpp @@ -294,7 +294,7 @@ bool RewardsValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &t return(true); } -uint64_t myIs_unlockedtx_inmempool(uint256 &txid,int32_t &vout,uint64_t refsbits,uint256 reffundingtxid,uint64_t needed) +static uint64_t myIs_unlockedtx_inmempool(uint256 &txid,int32_t &vout,uint64_t refsbits,uint256 reffundingtxid,uint64_t needed) { uint8_t funcid; uint64_t sbits,nValue; uint256 fundingtxid; char str[65]; memset(&txid,0,sizeof(txid)); From 4ad414194ff4adbdb0e7421ec3d7394bb17f01f9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 12 Sep 2018 00:40:56 -1100 Subject: [PATCH 02/14] Test --- src/cc/oracles.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cc/oracles.cpp b/src/cc/oracles.cpp index 442da7a30..4226a23cd 100644 --- a/src/cc/oracles.cpp +++ b/src/cc/oracles.cpp @@ -242,7 +242,7 @@ static uint256 myIs_baton_spentinmempool(uint256 batontxid,int32_t batonvout) const CTransaction &tx = e.GetTx(); if ( tx.vout.size() > 0 && tx.vin.size() > 1 && batontxid == tx.vin[1].prevout.hash && batonvout == tx.vin[1].prevout.n ) { - const uint256 &hash = tx.GetHash(); + const uint256 &txid = tx.GetHash(); char str[65]; fprintf(stderr,"found baton spent in mempool %s\n",uint256_str(str,txid)); return(txid); } From f2b287a693fde4ee71637ba9906a2dcbea90cdb1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 12 Sep 2018 00:44:29 -1100 Subject: [PATCH 03/14] Test --- src/cc/dapps/oraclefeed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cc/dapps/oraclefeed.c b/src/cc/dapps/oraclefeed.c index 46c2a305b..73bd0d7a8 100644 --- a/src/cc/dapps/oraclefeed.c +++ b/src/cc/dapps/oraclefeed.c @@ -508,7 +508,7 @@ int32_t main(int32_t argc,char **argv) while ( 1 ) { retstr = 0; - if ( acheight != (height= get_KMDheight(acname)) && (clijson= get_komodocli(&retstr,acname,"oraclesinfo",oraclestr,"","")) != 0 ) + if ( (clijson= get_komodocli(&retstr,acname,"oraclesinfo",oraclestr,"","")) != 0 ) { acheight = height; if ( (regjson= jarray(&n,clijson,"registered")) != 0 ) From 76722d74003255e1b041abd89902b7fe1c957ba1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 12 Sep 2018 00:46:21 -1100 Subject: [PATCH 04/14] Test --- src/cc/dapps/oraclefeed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cc/dapps/oraclefeed.c b/src/cc/dapps/oraclefeed.c index 73bd0d7a8..94ea2965c 100644 --- a/src/cc/dapps/oraclefeed.c +++ b/src/cc/dapps/oraclefeed.c @@ -522,7 +522,7 @@ int32_t main(int32_t argc,char **argv) { if ( (clijson2= get_komodocli(&retstr2,acname,"oraclesdata",oraclestr,hexstr,"")) != 0 ) { - //printf("data.(%s)\n",jprint(clijson2,0)); + printf("data.(%s)\n",jprint(clijson2,0)); txid = komodobroadcast(acname,clijson2); if ( bits256_nonz(txid) != 0 ) { From c46ccfc3faab36d2807783d6841b3e7ae7c4ee14 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 12 Sep 2018 00:48:58 -1100 Subject: [PATCH 05/14] Test --- src/cc/oracles.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cc/oracles.cpp b/src/cc/oracles.cpp index 4226a23cd..39f14293a 100644 --- a/src/cc/oracles.cpp +++ b/src/cc/oracles.cpp @@ -802,8 +802,8 @@ std::string OracleData(int64_t txfee,uint256 oracletxid,std::vector da mtx.vout.push_back(MakeCC1vout(cp->evalcode,txfee,batonpk)); mtx.vout.push_back(CTxOut(datafee,CScript() << ParseHex(HexStr(mypk)) << OP_CHECKSIG)); return(FinalizeCCTx(0,cp,mtx,mypk,txfee,EncodeOraclesData('D',oracletxid,batontxid,mypk,data))); - } - } + } else fprint(stderr,"couldnt add normal inputs\n"); + } else fprintf(stderr,"couldnt add normal inputs\n"); return(""); } From e349a608ccedb4e6827d5f03babbb59256d9fbec Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 12 Sep 2018 00:49:30 -1100 Subject: [PATCH 06/14] Test --- src/cc/oracles.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cc/oracles.cpp b/src/cc/oracles.cpp index 39f14293a..3c33b8e6e 100644 --- a/src/cc/oracles.cpp +++ b/src/cc/oracles.cpp @@ -802,7 +802,7 @@ std::string OracleData(int64_t txfee,uint256 oracletxid,std::vector da mtx.vout.push_back(MakeCC1vout(cp->evalcode,txfee,batonpk)); mtx.vout.push_back(CTxOut(datafee,CScript() << ParseHex(HexStr(mypk)) << OP_CHECKSIG)); return(FinalizeCCTx(0,cp,mtx,mypk,txfee,EncodeOraclesData('D',oracletxid,batontxid,mypk,data))); - } else fprint(stderr,"couldnt add normal inputs\n"); + } else fprintf(stderr,"couldnt add normal inputs\n"); } else fprintf(stderr,"couldnt add normal inputs\n"); return(""); } From 55e1d9dcdf28115c1d21eb1f9eadf27e3ff368f4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 12 Sep 2018 00:55:38 -1100 Subject: [PATCH 07/14] Test --- src/cc/CCtx.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/cc/CCtx.cpp b/src/cc/CCtx.cpp index b92879359..98ae31f58 100644 --- a/src/cc/CCtx.cpp +++ b/src/cc/CCtx.cpp @@ -331,6 +331,7 @@ int64_t AddNormalinputs(CMutableTransaction &mtx,CPubKey mypk,int64_t total,int3 { txid = out.tx->GetHash(); vout = out.i; + char str[65]; fprintf(stderr,"check %s/v%d\n",uint256_str(str,txid),vout); if ( GetTransaction(txid,tx,hashBlock,false) != 0 && tx.vout.size() > 0 && vout < tx.vout.size() && tx.vout[vout].scriptPubKey.IsPayToCryptoCondition() == 0 ) { if ( mtx.vin.size() > 0 ) @@ -349,8 +350,10 @@ int64_t AddNormalinputs(CMutableTransaction &mtx,CPubKey mypk,int64_t total,int3 if ( i != n ) continue; } + fprintf(stderr,"check in mempool\n"); if ( myIsutxo_spentinmempool(txid,vout) == 0 ) { + fprintf(stderr,"add to vins array.%d of %d\n",n,maxutxos); up = &utxos[n++]; up->txid = txid; up->nValue = out.tx->vout[out.i].nValue; From 6ea9a80b94d5bbe91fabe8f10846784f5053cca3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 12 Sep 2018 00:59:41 -1100 Subject: [PATCH 08/14] Test --- src/cc/CCtx.cpp | 5 ++--- src/cc/oracles.cpp | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/cc/CCtx.cpp b/src/cc/CCtx.cpp index 98ae31f58..dd6269eb2 100644 --- a/src/cc/CCtx.cpp +++ b/src/cc/CCtx.cpp @@ -331,7 +331,6 @@ int64_t AddNormalinputs(CMutableTransaction &mtx,CPubKey mypk,int64_t total,int3 { txid = out.tx->GetHash(); vout = out.i; - char str[65]; fprintf(stderr,"check %s/v%d\n",uint256_str(str,txid),vout); if ( GetTransaction(txid,tx,hashBlock,false) != 0 && tx.vout.size() > 0 && vout < tx.vout.size() && tx.vout[vout].scriptPubKey.IsPayToCryptoCondition() == 0 ) { if ( mtx.vin.size() > 0 ) @@ -350,14 +349,13 @@ int64_t AddNormalinputs(CMutableTransaction &mtx,CPubKey mypk,int64_t total,int3 if ( i != n ) continue; } - fprintf(stderr,"check in mempool\n"); if ( myIsutxo_spentinmempool(txid,vout) == 0 ) { - fprintf(stderr,"add to vins array.%d of %d\n",n,maxutxos); up = &utxos[n++]; up->txid = txid; up->nValue = out.tx->vout[out.i].nValue; up->vout = vout; + fprintf(stderr,"add %.8f to vins array.%d of %d\n",(double)up->nValue/COIN,n,maxutxos); if ( n >= maxutxos ) break; } @@ -390,6 +388,7 @@ int64_t AddNormalinputs(CMutableTransaction &mtx,CPubKey mypk,int64_t total,int3 remains -= up->nValue; utxos[ind] = utxos[--n]; memset(&utxos[n],0,sizeof(utxos[n])); + fprintf(stderr,"totalinputs %.8f vs total %.8f i.%d vs max.%d\n",(double)totalinputs/COIN,(double)total/COIN,i,maxinputs); if ( totalinputs >= total || (i+1) >= maxinputs ) break; } diff --git a/src/cc/oracles.cpp b/src/cc/oracles.cpp index 3c33b8e6e..3e63fbd75 100644 --- a/src/cc/oracles.cpp +++ b/src/cc/oracles.cpp @@ -787,14 +787,14 @@ std::string OracleData(int64_t txfee,uint256 oracletxid,std::vector da if ( txfee == 0 ) txfee = 10000; GetCCaddress(cp,coinaddr,mypk); - if ( AddNormalinputs(mtx,mypk,2*txfee,3) > 0 ) // have enough funds even if baton utxo not there + if ( AddNormalinputs(mtx,mypk,2*txfee,16) > 0 ) // have enough funds even if baton utxo not there { batonpk = OracleBatonPk(batonaddr,cp); batontxid = OracleBatonUtxo(txfee,cp,oracletxid,batonaddr,mypk,prevdata); if ( batontxid != zeroid ) // not impossible to fail, but hopefully a very rare event mtx.vin.push_back(CTxIn(batontxid,1,CScript())); else fprintf(stderr,"warning: couldnt find baton utxo %s\n",batonaddr); - if ( (inputs= AddOracleInputs(cp,mtx,mypk,datafee,60)) > 0 ) + if ( (inputs= AddOracleInputs(cp,mtx,mypk,datafee,40)) > 0 ) { if ( inputs > datafee ) CCchange = (inputs - datafee); From c5c1aaa1dccba096b049d4be0702e44c3def3ee6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 12 Sep 2018 00:59:51 -1100 Subject: [PATCH 09/14] Test --- src/cc/oracles.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cc/oracles.cpp b/src/cc/oracles.cpp index 3e63fbd75..01d62ccf5 100644 --- a/src/cc/oracles.cpp +++ b/src/cc/oracles.cpp @@ -787,7 +787,7 @@ std::string OracleData(int64_t txfee,uint256 oracletxid,std::vector da if ( txfee == 0 ) txfee = 10000; GetCCaddress(cp,coinaddr,mypk); - if ( AddNormalinputs(mtx,mypk,2*txfee,16) > 0 ) // have enough funds even if baton utxo not there + if ( AddNormalinputs(mtx,mypk,2*txfee,3) > 0 ) // have enough funds even if baton utxo not there { batonpk = OracleBatonPk(batonaddr,cp); batontxid = OracleBatonUtxo(txfee,cp,oracletxid,batonaddr,mypk,prevdata); From 4b19e1904e71a0ef2300c6a30d200ba44be23f7b Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 12 Sep 2018 01:06:41 -1100 Subject: [PATCH 10/14] Test --- src/cc/CCtx.cpp | 5 ++++- src/cc/oracles.cpp | 13 +++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/cc/CCtx.cpp b/src/cc/CCtx.cpp index dd6269eb2..9b873dcc1 100644 --- a/src/cc/CCtx.cpp +++ b/src/cc/CCtx.cpp @@ -355,7 +355,7 @@ int64_t AddNormalinputs(CMutableTransaction &mtx,CPubKey mypk,int64_t total,int3 up->txid = txid; up->nValue = out.tx->vout[out.i].nValue; up->vout = vout; - fprintf(stderr,"add %.8f to vins array.%d of %d\n",(double)up->nValue/COIN,n,maxutxos); + //fprintf(stderr,"add %.8f to vins array.%d of %d\n",(double)up->nValue/COIN,n,maxutxos); if ( n >= maxutxos ) break; } @@ -394,7 +394,10 @@ int64_t AddNormalinputs(CMutableTransaction &mtx,CPubKey mypk,int64_t total,int3 } free(utxos); if ( totalinputs >= total ) + { + fprintf(stderr,"return totalinputs %.8f\n",(double)totalinputs/COIN); return(totalinputs); + } #endif return(0); } diff --git a/src/cc/oracles.cpp b/src/cc/oracles.cpp index 01d62ccf5..41081f331 100644 --- a/src/cc/oracles.cpp +++ b/src/cc/oracles.cpp @@ -523,10 +523,10 @@ int64_t OraclePrice(int32_t height,uint256 reforacletxid,char *markeraddr,char * int64_t IsOraclesvout(struct CCcontract_info *cp,const CTransaction& tx,int32_t v) { - char destaddr[64]; + //char destaddr[64]; if ( tx.vout[v].scriptPubKey.IsPayToCryptoCondition() != 0 ) { - if ( Getscriptaddress(destaddr,tx.vout[v].scriptPubKey) > 0 )// && strcmp(destaddr,cp->unspendableCCaddr) == 0 ) + //if ( Getscriptaddress(destaddr,tx.vout[v].scriptPubKey) > 0 && strcmp(destaddr,cp->unspendableCCaddr) == 0 ) return(tx.vout[v].nValue); } return(0); @@ -669,6 +669,7 @@ int64_t AddOracleInputs(struct CCcontract_info *cp,CMutableTransaction &mtx,CPub { txid = it->first.txhash; vout = (int32_t)it->first.index; + char str[65]; fprintf(stderr,"oracle check %s/v%d\n",uint256_str(str,txid),vout); if ( GetTransaction(txid,vintx,hashBlock,false) != 0 ) { // get valid CC payments @@ -681,8 +682,8 @@ int64_t AddOracleInputs(struct CCcontract_info *cp,CMutableTransaction &mtx,CPub n++; if ( (total > 0 && totalinputs >= total) || (maxinputs > 0 && n >= maxinputs) ) break; - } - } + } else fprintf(stderr,"nValue %.8f or utxo memspent\n",(double)nValue/COIN); + } else fprintf(stderr,"couldnt find transaction\n"); } return(totalinputs); } @@ -794,7 +795,7 @@ std::string OracleData(int64_t txfee,uint256 oracletxid,std::vector da if ( batontxid != zeroid ) // not impossible to fail, but hopefully a very rare event mtx.vin.push_back(CTxIn(batontxid,1,CScript())); else fprintf(stderr,"warning: couldnt find baton utxo %s\n",batonaddr); - if ( (inputs= AddOracleInputs(cp,mtx,mypk,datafee,40)) > 0 ) + if ( (inputs= AddOracleInputs(cp,mtx,mypk,datafee,60)) > 0 ) { if ( inputs > datafee ) CCchange = (inputs - datafee); @@ -802,7 +803,7 @@ std::string OracleData(int64_t txfee,uint256 oracletxid,std::vector da mtx.vout.push_back(MakeCC1vout(cp->evalcode,txfee,batonpk)); mtx.vout.push_back(CTxOut(datafee,CScript() << ParseHex(HexStr(mypk)) << OP_CHECKSIG)); return(FinalizeCCTx(0,cp,mtx,mypk,txfee,EncodeOraclesData('D',oracletxid,batontxid,mypk,data))); - } else fprintf(stderr,"couldnt add normal inputs\n"); + } else fprintf(stderr,"couldnt add oracle inputs\n"); } else fprintf(stderr,"couldnt add normal inputs\n"); return(""); } From 7fb5e4aa6f2303fe198c42e54210d3602fe76d4d Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 12 Sep 2018 01:11:24 -1100 Subject: [PATCH 11/14] -print --- src/cc/CCtx.cpp | 4 ++-- src/cc/oracles.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cc/CCtx.cpp b/src/cc/CCtx.cpp index 9b873dcc1..50bb9616f 100644 --- a/src/cc/CCtx.cpp +++ b/src/cc/CCtx.cpp @@ -388,14 +388,14 @@ int64_t AddNormalinputs(CMutableTransaction &mtx,CPubKey mypk,int64_t total,int3 remains -= up->nValue; utxos[ind] = utxos[--n]; memset(&utxos[n],0,sizeof(utxos[n])); - fprintf(stderr,"totalinputs %.8f vs total %.8f i.%d vs max.%d\n",(double)totalinputs/COIN,(double)total/COIN,i,maxinputs); + //fprintf(stderr,"totalinputs %.8f vs total %.8f i.%d vs max.%d\n",(double)totalinputs/COIN,(double)total/COIN,i,maxinputs); if ( totalinputs >= total || (i+1) >= maxinputs ) break; } free(utxos); if ( totalinputs >= total ) { - fprintf(stderr,"return totalinputs %.8f\n",(double)totalinputs/COIN); + //fprintf(stderr,"return totalinputs %.8f\n",(double)totalinputs/COIN); return(totalinputs); } #endif diff --git a/src/cc/oracles.cpp b/src/cc/oracles.cpp index 41081f331..7a5f38c00 100644 --- a/src/cc/oracles.cpp +++ b/src/cc/oracles.cpp @@ -243,7 +243,7 @@ static uint256 myIs_baton_spentinmempool(uint256 batontxid,int32_t batonvout) if ( tx.vout.size() > 0 && tx.vin.size() > 1 && batontxid == tx.vin[1].prevout.hash && batonvout == tx.vin[1].prevout.n ) { const uint256 &txid = tx.GetHash(); - char str[65]; fprintf(stderr,"found baton spent in mempool %s\n",uint256_str(str,txid)); + //char str[65]; fprintf(stderr,"found baton spent in mempool %s\n",uint256_str(str,txid)); return(txid); } } @@ -669,7 +669,7 @@ int64_t AddOracleInputs(struct CCcontract_info *cp,CMutableTransaction &mtx,CPub { txid = it->first.txhash; vout = (int32_t)it->first.index; - char str[65]; fprintf(stderr,"oracle check %s/v%d\n",uint256_str(str,txid),vout); + //char str[65]; fprintf(stderr,"oracle check %s/v%d\n",uint256_str(str,txid),vout); if ( GetTransaction(txid,vintx,hashBlock,false) != 0 ) { // get valid CC payments From b2da43cf03c4e839854dd220b9dfca5b5bc0067f Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 12 Sep 2018 01:15:17 -1100 Subject: [PATCH 12/14] Test --- src/cc/oracles.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cc/oracles.cpp b/src/cc/oracles.cpp index 7a5f38c00..a74871d8a 100644 --- a/src/cc/oracles.cpp +++ b/src/cc/oracles.cpp @@ -554,8 +554,8 @@ bool OraclesDataValidate(struct CCcontract_info *cp,Eval* eval,const CTransactio else { //fprintf(stderr,"vini.%d check hash and vout\n",i); - if ( hashBlock == zerohash ) - return eval->Invalid("cant Oracles from mempool"); + //if ( hashBlock == zerohash ) + // return eval->Invalid("cant Oracles from mempool"); if ( (assetoshis= IsOraclesvout(cp,vinTx,tx.vin[i].prevout.n)) != 0 ) { if ( i == 1 && vinTx.vout[1].scriptPubKey != tx.vout[1].scriptPubKey ) From 5b7e795919caa662d53f30a2b3fec784c4301d6e Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 12 Sep 2018 01:21:23 -1100 Subject: [PATCH 13/14] Test --- src/cc/oracles.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cc/oracles.cpp b/src/cc/oracles.cpp index a74871d8a..bee27bffa 100644 --- a/src/cc/oracles.cpp +++ b/src/cc/oracles.cpp @@ -682,7 +682,7 @@ int64_t AddOracleInputs(struct CCcontract_info *cp,CMutableTransaction &mtx,CPub n++; if ( (total > 0 && totalinputs >= total) || (maxinputs > 0 && n >= maxinputs) ) break; - } else fprintf(stderr,"nValue %.8f or utxo memspent\n",(double)nValue/COIN); + } //else fprintf(stderr,"nValue %.8f or utxo memspent\n",(double)nValue/COIN); } else fprintf(stderr,"couldnt find transaction\n"); } return(totalinputs); From 4084a149ed5490a732f70a022d6438ab47302d82 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 12 Sep 2018 01:21:58 -1100 Subject: [PATCH 14/14] Test --- src/cc/oracles.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cc/oracles.cpp b/src/cc/oracles.cpp index bee27bffa..c24ad5a8b 100644 --- a/src/cc/oracles.cpp +++ b/src/cc/oracles.cpp @@ -803,7 +803,7 @@ std::string OracleData(int64_t txfee,uint256 oracletxid,std::vector da mtx.vout.push_back(MakeCC1vout(cp->evalcode,txfee,batonpk)); mtx.vout.push_back(CTxOut(datafee,CScript() << ParseHex(HexStr(mypk)) << OP_CHECKSIG)); return(FinalizeCCTx(0,cp,mtx,mypk,txfee,EncodeOraclesData('D',oracletxid,batontxid,mypk,data))); - } else fprintf(stderr,"couldnt add oracle inputs\n"); + } else fprintf(stderr,"couldnt find enough oracle inputs, limit 1 per utxo\n"); } else fprintf(stderr,"couldnt add normal inputs\n"); return(""); }