myIsutxo_spentinmempool

This commit is contained in:
jl777
2018-08-02 01:10:04 -11:00
parent f2e6ae7294
commit 079be98a2e
5 changed files with 29 additions and 15 deletions

View File

@@ -346,6 +346,26 @@ UniValue getdifficulty(const UniValue& params, bool fHelp)
return GetNetworkDifficulty();
}
bool myIsutxo_spentinmempool(uint256 txid,int32_t vout)
{
char *uint256_str(char *str,uint256);
char str[65];
LOCK(mempool.cs);
BOOST_FOREACH(const CTxMemPoolEntry &e,mempool.mapTx)
{
const CTransaction &tx = e.GetTx();
const uint256 &hash = tx.GetHash();
BOOST_FOREACH(const CTxIn &txin,tx.vin)
{
fprintf(stderr,"%s/v%d ",uint256_str(str,txin.prevout.hash),txin.prevout.n);
if ( txin.prevout.n == vout && txin.prevout.hash == txid )
return(true);
}
fprintf(stderr,"are vins for %s\n",uint256_str(str,hash));
}
return(false);
}
UniValue mempoolToJSON(bool fVerbose = false)
{
if (fVerbose)