aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Maxwell <greg@xiph.org>2016-12-06 06:39:14 +0000
committerMarcoFalke <falke.marco@gmail.com>2016-12-14 13:55:14 +0100
commit35174a0280845e9583a3af1fcf57ee1f98238539 (patch)
treef8f31f756956b3da1b95d1f129c22acd7ee1e3c1
parenta0f7ececfd096df398fc5e4aad07f1a43760afb4 (diff)
downloadbitcoin-35174a0280845e9583a3af1fcf57ee1f98238539.tar.xz
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: #9290 Rebased-From: f692fce8a49e05e25f1c767aae1e50db419caebe
-rw-r--r--src/wallet/wallet.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index 5b35e49a0f..0403b35585 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -1449,9 +1449,10 @@ void CWallet::ReacceptWalletTransactions()
bool CWalletTx::RelayWalletTransaction()
{
assert(pwallet->GetBroadcastTransactions());
- if (!IsCoinBase())
+ if (!IsCoinBase() && !isAbandoned() && GetDepthInMainChain() == 0)
{
- if (GetDepthInMainChain() == 0 && !isAbandoned() && InMempool()) {
+ /* GetDepthInMainChain already catches known conflicts. */
+ if (InMempool() || AcceptToMemoryPool(false, maxTxFee)) {
LogPrintf("Relaying wtx %s\n", GetHash().ToString());
RelayTransaction((CTransaction)*this);
return true;