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 <uint8_t> &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<uint8_t> vopret,data;
}
}
}
+ while ( myIsutxo_spentinmempool(batontxid,1) != 0 )
+ batontxid = myIs_baton_spentinmempool(batontxid,1);
return(batontxid);
}
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<std::pair<CAddressUnspentKey, CAddressUnspentValue> >::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 )
{
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));