Skip to content

Commit 35174a0

Browse files
gmaxwellMarcoFalke
authored andcommitted
Make RelayWalletTransaction attempt to AcceptToMemoryPool.
This resolves an issue where a wallet transaction which failed to relay previously because it couldn't make it into the mempool will not try again until restart, even though mempool conditions may have changed. Abandoned and known-conflicted transactions are skipped. Some concern was expressed that there may be users with many unknown conflicts would waste a lot of CPU time trying to add them to their memory pools over and over again. But I am doubtful these users exist in any number, if they do exist they have worse problems, and they can mitigate any performance issue this might have by abandoning the transactions in question. Github-Pull: bitcoin#9290 Rebased-From: f692fce
1 parent a0f7ece commit 35174a0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/wallet/wallet.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1449,9 +1449,10 @@ void CWallet::ReacceptWalletTransactions()
14491449
bool CWalletTx::RelayWalletTransaction()
14501450
{
14511451
assert(pwallet->GetBroadcastTransactions());
1452-
if (!IsCoinBase())
1452+
if (!IsCoinBase() && !isAbandoned() && GetDepthInMainChain() == 0)
14531453
{
1454-
if (GetDepthInMainChain() == 0 && !isAbandoned() && InMempool()) {
1454+
/* GetDepthInMainChain already catches known conflicts. */
1455+
if (InMempool() || AcceptToMemoryPool(false, maxTxFee)) {
14551456
LogPrintf("Relaying wtx %s\n", GetHash().ToString());
14561457
RelayTransaction((CTransaction)*this);
14571458
return true;

0 commit comments

Comments
 (0)