myGettxout
This commit is contained in:
@@ -53,6 +53,7 @@ static const uint256 zeroid;
|
||||
bool myGetTransaction(const uint256 &hash, CTransaction &txOut, uint256 &hashBlock);
|
||||
int32_t is_hexstr(char *str,int32_t n);
|
||||
bool myAddtomempool(CTransaction &tx);
|
||||
uint64_t myGettxout(uint256 hash,int32_t n);
|
||||
|
||||
// CCcustom
|
||||
CPubKey GetUnspendable(struct CCcontract_info *cp,uint8_t *unspendablepriv);
|
||||
|
||||
@@ -220,7 +220,8 @@ uint64_t AddNormalinputs(CMutableTransaction &mtx,CPubKey mypk,uint64_t total,in
|
||||
break;
|
||||
if ( j != mtx.vin.size() )
|
||||
continue;
|
||||
if ( GetTransaction(txid,tx,hashBlock,false) != 0 && tx.IsCoinBase() == 0 )
|
||||
if ( myGettxout(txid,vout) == out.tx->vout[out.i].nValue )
|
||||
//if ( GetTransaction(txid,tx,hashBlock,false) != 0 && tx.IsCoinBase() == 0 )
|
||||
{
|
||||
mtx.vin.push_back(CTxIn(txid,vout,CScript()));
|
||||
nValue = out.tx->vout[out.i].nValue;
|
||||
|
||||
13
src/main.cpp
13
src/main.cpp
@@ -1603,6 +1603,19 @@ bool GetAddressUnspent(uint160 addressHash, int type,
|
||||
return true;
|
||||
}
|
||||
|
||||
uint64_t myGettxout(uint256 hash,int32_t n)
|
||||
{
|
||||
CCoins coins;
|
||||
LOCK(cs_main);
|
||||
LOCK(mempool.cs);
|
||||
CCoinsViewMemPool view(pcoinsTip, mempool);
|
||||
if (!view.GetCoins(hash, coins))
|
||||
return(0);
|
||||
if ( n<0 || (unsigned int)n>=coins.vout.size() || coins.vout[n].IsNull() )
|
||||
return(0);
|
||||
else return(coins.vout[n].nValue);
|
||||
}
|
||||
|
||||
bool myAddtomempool(CTransaction &tx)
|
||||
{
|
||||
CValidationState state; CTransaction Ltx; bool fMissingInputs,fOverrideFees = false;
|
||||
|
||||
Reference in New Issue
Block a user