This commit is contained in:
@@ -237,26 +237,31 @@ int64_t AddMarmaraCoinbases(struct CCcontract_info *cp,CMutableTransaction &mtx,
|
|||||||
GetCCaddress(cp,coinaddr,poolpk);
|
GetCCaddress(cp,coinaddr,poolpk);
|
||||||
SetCCunspents(unspentOutputs,coinaddr);
|
SetCCunspents(unspentOutputs,coinaddr);
|
||||||
unlocks = MarmaraUnlockht(firstheight);
|
unlocks = MarmaraUnlockht(firstheight);
|
||||||
|
fprintf(stderr,"check coinaddr.(%s)\n",coinaddr);
|
||||||
for (std::vector<std::pair<CAddressUnspentKey, CAddressUnspentValue> >::const_iterator it=unspentOutputs.begin(); it!=unspentOutputs.end(); it++)
|
for (std::vector<std::pair<CAddressUnspentKey, CAddressUnspentValue> >::const_iterator it=unspentOutputs.begin(); it!=unspentOutputs.end(); it++)
|
||||||
{
|
{
|
||||||
txid = it->first.txhash;
|
txid = it->first.txhash;
|
||||||
vout = (int32_t)it->first.index;
|
vout = (int32_t)it->first.index;
|
||||||
if ( GetTransaction(txid,vintx,hashBlock,false) != 0 && vintx.IsCoinBase() != 0 )
|
fprintf(stderr,"txid.%s/v%d\n",txid.GetHex().c_str(),vout);
|
||||||
|
if ( GetTransaction(txid,vintx,hashBlock,false) != 0 )
|
||||||
{
|
{
|
||||||
if ( DecodeMaramaraCoinbaseOpRet(vintx.vout[1].scriptPubKey,pk,ht,unlockht) == 'C' && unlockht == unlocks && pk == poolpk )
|
if ( vintx.IsCoinBase() != 0 )
|
||||||
{
|
{
|
||||||
if ( (nValue= IsMarmaravout(cp,vintx,vout)) > 0 && myIsutxo_spentinmempool(txid,vout) == 0 )
|
if ( DecodeMaramaraCoinbaseOpRet(vintx.vout[1].scriptPubKey,pk,ht,unlockht) == 'C' && unlockht == unlocks && pk == poolpk )
|
||||||
{
|
{
|
||||||
if ( maxinputs != 0 )
|
if ( (nValue= IsMarmaravout(cp,vintx,vout)) > 0 && myIsutxo_spentinmempool(txid,vout) == 0 )
|
||||||
mtx.vin.push_back(CTxIn(txid,vout,CScript()));
|
{
|
||||||
nValue = it->second.satoshis;
|
if ( maxinputs != 0 )
|
||||||
totalinputs += nValue;
|
mtx.vin.push_back(CTxIn(txid,vout,CScript()));
|
||||||
n++;
|
nValue = it->second.satoshis;
|
||||||
if ( maxinputs > 0 && n >= maxinputs )
|
totalinputs += nValue;
|
||||||
break;
|
n++;
|
||||||
}
|
if ( maxinputs > 0 && n >= maxinputs )
|
||||||
}
|
break;
|
||||||
}
|
} else fprintf(stderr,"nValue.%8f\n",(double)nValue/COIN);
|
||||||
|
} else fprintf(stderr,"decode error\n");
|
||||||
|
} else fprintf(stderr,"not coinbase\n");
|
||||||
|
} else fprintf(stderr,"error getting tx\n");
|
||||||
}
|
}
|
||||||
return(totalinputs);
|
return(totalinputs);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5544,7 +5544,7 @@ UniValue marmara_poolpayout(const UniValue& params, bool fHelp)
|
|||||||
perc = atof(params[0].get_str().c_str()) / 100.;
|
perc = atof(params[0].get_str().c_str()) / 100.;
|
||||||
firstheight = atol(params[1].get_str().c_str());
|
firstheight = atol(params[1].get_str().c_str());
|
||||||
jsonstr = (char *)params[2].get_str().c_str();
|
jsonstr = (char *)params[2].get_str().c_str();
|
||||||
fprintf(stderr,"perc %.2f ht.%d (%s)\n",perc,firstheight,jsonstr);
|
fprintf(stderr,"perc %.8f ht.%d (%s)\n",perc,firstheight,jsonstr);
|
||||||
return(MarmaraPoolPayout(0,firstheight,perc,jsonstr)); // [[pk0, shares0], [pk1, shares1], ...]
|
return(MarmaraPoolPayout(0,firstheight,perc,jsonstr)); // [[pk0, shares0], [pk1, shares1], ...]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user