Merge pull request #594 from UdjinM6/fix_conflicted_dstx

Fix: dstx stuck sometimes
This commit is contained in:
evan82 2015-09-01 20:52:23 -07:00
commit b3d0f8056e
2 changed files with 10 additions and 4 deletions

View File

@ -1114,7 +1114,10 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa
unsigned int nSize = entry.GetTxSize();
// Don't accept it if it can't get into a block
if(!ignoreFees){
// but prioritise dstx and don't check fees for it
if(mapDarksendBroadcastTxes.count(hash)) {
mempool.PrioritiseTransaction(hash, hash.ToString(), 1000, 0.1*COIN);
} else if(!ignoreFees){
CAmount txMinFee = GetMinRelayFee(tx, nSize, true);
if (fLimitFree && nFees < txMinFee)
return state.DoS(0, error("AcceptToMemoryPool : not enough fees %s, %d < %d",
@ -1187,7 +1190,7 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa
}
bool AcceptableInputs(CTxMemPool& pool, CValidationState &state, const CTransaction &tx, bool fLimitFree,
bool* pfMissingInputs, bool fRejectInsaneFee, bool ignoreFees)
bool* pfMissingInputs, bool fRejectInsaneFee, bool isDSTX)
{
AssertLockHeld(cs_main);
if (pfMissingInputs)
@ -1306,7 +1309,10 @@ bool AcceptableInputs(CTxMemPool& pool, CValidationState &state, const CTransact
unsigned int nSize = entry.GetTxSize();
// Don't accept it if it can't get into a block
if(!ignoreFees){
// but prioritise dstx and don't check fees for it
if(isDSTX) {
mempool.PrioritiseTransaction(hash, hash.ToString(), 1000, 0.1*COIN);
} else { // same as !ignoreFees for AcceptToMemoryPool
CAmount txMinFee = GetMinRelayFee(tx, nSize, true);
if (fLimitFree && nFees < txMinFee)
return state.DoS(0, error("AcceptableInputs : not enough fees %s, %d < %d",

View File

@ -238,7 +238,7 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa
bool* pfMissingInputs, bool fRejectInsaneFee=false, bool ignoreFees=false);
bool AcceptableInputs(CTxMemPool& pool, CValidationState &state, const CTransaction &tx, bool fLimitFree,
bool* pfMissingInputs, bool fRejectInsaneFee=false, bool ignoreFees=false);
bool* pfMissingInputs, bool fRejectInsaneFee=false, bool isDSTX=false);
int GetInputAge(CTxIn& vin);
int GetInputAgeIX(uint256 nTXHash, CTxIn& vin);