Make RelayWalletTransaction attempt to AcceptToMemoryPool.

This commit is contained in:
Gregory Maxwell
2016-12-06 06:39:14 +00:00
committed by lateminer
parent 40ebee8dec
commit c1a0128033

View File

@@ -1799,9 +1799,11 @@ void CWallet::ReacceptWalletTransactions()
bool CWalletTx::RelayWalletTransaction()
{
assert(pwallet->GetBroadcastTransactions());
if (!IsCoinBase() && !IsCoinStake())
if (!IsCoinBase() && !IsCoinStake() && !isAbandoned() && GetDepthInMainChain() == 0)
{
if (GetDepthInMainChain() == 0 && !isAbandoned() && InMempool()) {
CValidationState state;
/* GetDepthInMainChain already catches known conflicts. */
if (InMempool() || AcceptToMemoryPool(maxTxFee, state)) {
LogPrintf("Relaying wtx %s\n", GetHash().ToString());
RelayTransaction((CTransaction)*this);
return true;