Test
This commit is contained in:
@@ -59,7 +59,7 @@ std::string FinalizeCCTx(uint8_t evalcode,CMutableTransaction &mtx,CPubKey mypk,
|
|||||||
mycond = MakeCC(evalcode,mypk);
|
mycond = MakeCC(evalcode,mypk);
|
||||||
GetCCaddress(evalcode,unspendable,unspendablepk);
|
GetCCaddress(evalcode,unspendable,unspendablepk);
|
||||||
othercond = MakeCC(evalcode,unspendablepk);
|
othercond = MakeCC(evalcode,unspendablepk);
|
||||||
fprintf(stderr,"myCCaddr.(%s) %p vs unspendable.(%s) %p\n",myaddr,mycond,unspendable,othercond);
|
//fprintf(stderr,"myCCaddr.(%s) %p vs unspendable.(%s) %p\n",myaddr,mycond,unspendable,othercond);
|
||||||
memset(utxovalues,0,sizeof(utxovalues));
|
memset(utxovalues,0,sizeof(utxovalues));
|
||||||
for (i=0; i<n; i++)
|
for (i=0; i<n; i++)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -86,7 +86,6 @@ bool FaucetExactAmounts(Eval* eval,const CTransaction &tx,int32_t minage)
|
|||||||
bool FaucetValidate(Eval* eval,const CTransaction &tx)
|
bool FaucetValidate(Eval* eval,const CTransaction &tx)
|
||||||
{
|
{
|
||||||
int32_t numvins,numvouts,preventCCvins,preventCCvouts,i;
|
int32_t numvins,numvouts,preventCCvins,preventCCvouts,i;
|
||||||
fprintf(stderr,"FaucetValidate\n");
|
|
||||||
numvins = tx.vin.size();
|
numvins = tx.vin.size();
|
||||||
numvouts = tx.vout.size();
|
numvouts = tx.vout.size();
|
||||||
preventCCvins = preventCCvouts = -1;
|
preventCCvins = preventCCvouts = -1;
|
||||||
@@ -127,7 +126,6 @@ uint64_t AddFaucetInputs(CMutableTransaction &mtx,CPubKey pk,uint64_t total,int3
|
|||||||
std::vector<std::pair<CAddressUnspentKey, CAddressUnspentValue> > unspentOutputs;
|
std::vector<std::pair<CAddressUnspentKey, CAddressUnspentValue> > unspentOutputs;
|
||||||
GetCCaddress(EVAL_FAUCET,coinaddr,pk);
|
GetCCaddress(EVAL_FAUCET,coinaddr,pk);
|
||||||
SetCCunspents(unspentOutputs,coinaddr);
|
SetCCunspents(unspentOutputs,coinaddr);
|
||||||
//std::sort(unspentOutputs.begin(), unspentOutputs.end(), heightSort);
|
|
||||||
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;
|
||||||
@@ -178,7 +176,7 @@ std::string FaucetGet(uint64_t txfee)
|
|||||||
mtx.vout.push_back(MakeFaucetVout(CCchange,faucetpk));
|
mtx.vout.push_back(MakeFaucetVout(CCchange,faucetpk));
|
||||||
mtx.vout.push_back(CTxOut(nValue,CScript() << ParseHex(HexStr(mypk)) << OP_CHECKSIG));
|
mtx.vout.push_back(CTxOut(nValue,CScript() << ParseHex(HexStr(mypk)) << OP_CHECKSIG));
|
||||||
return(FinalizeCCTx(EVAL_FAUCET,mtx,mypk,txfee,opret));
|
return(FinalizeCCTx(EVAL_FAUCET,mtx,mypk,txfee,opret));
|
||||||
}
|
} else fprintf(stderr,"cant find faucet inputs\n");
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user