mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 20:12:57 +01:00
Merge pull request #594 from UdjinM6/fix_conflicted_dstx
Fix: dstx stuck sometimes
This commit is contained in:
commit
b3d0f8056e
12
src/main.cpp
12
src/main.cpp
@ -1114,7 +1114,10 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa
|
|||||||
unsigned int nSize = entry.GetTxSize();
|
unsigned int nSize = entry.GetTxSize();
|
||||||
|
|
||||||
// Don't accept it if it can't get into a block
|
// 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);
|
CAmount txMinFee = GetMinRelayFee(tx, nSize, true);
|
||||||
if (fLimitFree && nFees < txMinFee)
|
if (fLimitFree && nFees < txMinFee)
|
||||||
return state.DoS(0, error("AcceptToMemoryPool : not enough fees %s, %d < %d",
|
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 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);
|
AssertLockHeld(cs_main);
|
||||||
if (pfMissingInputs)
|
if (pfMissingInputs)
|
||||||
@ -1306,7 +1309,10 @@ bool AcceptableInputs(CTxMemPool& pool, CValidationState &state, const CTransact
|
|||||||
unsigned int nSize = entry.GetTxSize();
|
unsigned int nSize = entry.GetTxSize();
|
||||||
|
|
||||||
// Don't accept it if it can't get into a block
|
// 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);
|
CAmount txMinFee = GetMinRelayFee(tx, nSize, true);
|
||||||
if (fLimitFree && nFees < txMinFee)
|
if (fLimitFree && nFees < txMinFee)
|
||||||
return state.DoS(0, error("AcceptableInputs : not enough fees %s, %d < %d",
|
return state.DoS(0, error("AcceptableInputs : not enough fees %s, %d < %d",
|
||||||
|
@ -238,7 +238,7 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa
|
|||||||
bool* pfMissingInputs, bool fRejectInsaneFee=false, bool ignoreFees=false);
|
bool* pfMissingInputs, bool fRejectInsaneFee=false, bool ignoreFees=false);
|
||||||
|
|
||||||
bool AcceptableInputs(CTxMemPool& pool, CValidationState &state, const CTransaction &tx, bool fLimitFree,
|
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 GetInputAge(CTxIn& vin);
|
||||||
int GetInputAgeIX(uint256 nTXHash, CTxIn& vin);
|
int GetInputAgeIX(uint256 nTXHash, CTxIn& vin);
|
||||||
|
Loading…
Reference in New Issue
Block a user