bool myAddtomempool(CTransaction &tx)

This commit is contained in:
jl777
2018-08-01 04:22:56 -11:00
parent 4d332fc027
commit b46dc9da56
3 changed files with 10 additions and 6 deletions

View File

@@ -52,6 +52,7 @@ bool GetAddressUnspent(uint160 addressHash, int type,std::vector<std::pair<CAddr
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);
// CCcustom
CPubKey GetUnspendable(struct CCcontract_info *cp,uint8_t *unspendablepriv);

View File

@@ -126,12 +126,7 @@ void *dicefinish(void *_ptr)
if ( DecodeHexTx(tx,res) != 0 )
{
txid = tx.GetHash();
if ( mempool.exists(tx) == 0 )
{
CValidationState state;
bool fMissingInputs,fOverrideFees = false;
AcceptToMemoryPool(mempool, state, tx, false, &fMissingInputs, !fOverrideFees);
}
myAddtomempool(tx);
RelayTransaction(tx);
fprintf(stderr,"%s\nresult.(%s)\n",res.c_str(),uint256_str(str,txid));
}

View File

@@ -1603,6 +1603,14 @@ bool GetAddressUnspent(uint160 addressHash, int type,
return true;
}
bool myAddtomempool(CTransaction &tx)
{
CValidationState state; bool fMissingInputs,fOverrideFees = false;
if ( mempool.exists(tx) == 0 )
return(AcceptToMemoryPool(mempool, state, tx, false, &fMissingInputs, !fOverrideFees));
else return(false);
}
bool myGetTransaction(const uint256 &hash, CTransaction &txOut, uint256 &hashBlock)
{
// need a GetTransaction without lock so the validation code for assets can run without deadlock