This commit is contained in:
jl777
2018-07-23 05:41:43 -11:00
parent a81698329d
commit 1f5f9d297b
3 changed files with 20 additions and 17 deletions

View File

@@ -176,14 +176,17 @@ std::string FaucetGet(uint64_t txfee)
txfee = 10000;
faucetpk = GetUnspendable(EVAL_FAUCET,0);
mypk = pubkey2pk(Mypubkey());
if ( (inputs= AddFaucetInputs(mtx,faucetpk,nValue+txfee,60)) > 0 )
if ( AddNormalinputs(mtx,mypk,txfee,1) > 0 )
{
mtx.vout.push_back(CTxOut(nValue,CScript() << ParseHex(HexStr(mypk)) << OP_CHECKSIG));
if ( inputs > nValue )
CCchange = (inputs - nValue - txfee);
if ( CCchange != 0 )
mtx.vout.push_back(MakeFaucetVout(CCchange,faucetpk));
return(FinalizeCCTx(EVAL_FAUCET,mtx,mypk,txfee,opret));
if ( (inputs= AddFaucetInputs(mtx,faucetpk,nValue,60)) > 0 )
{
if ( inputs > nValue )
CCchange = (inputs - nValue);
if ( CCchange != 0 )
mtx.vout.push_back(MakeFaucetVout(CCchange,faucetpk));
mtx.vout.push_back(CTxOut(nValue,CScript() << ParseHex(HexStr(mypk)) << OP_CHECKSIG));
return(FinalizeCCTx(EVAL_FAUCET,mtx,mypk,txfee,opret));
}
}
return(0);
}