Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't resend wallet txs that aren't in our own mempool #7521

Merged
merged 1 commit into from Mar 3, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/wallet/wallet.cpp
Expand Up @@ -1265,7 +1265,7 @@ bool CWalletTx::RelayWalletTransaction()
assert(pwallet->GetBroadcastTransactions());
if (!IsCoinBase())
{
if (GetDepthInMainChain() == 0 && !isAbandoned()) {
if (GetDepthInMainChain() == 0 && !isAbandoned() && InMempool()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

orange flag: another coupling between the wallet and the full-node.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jonasschnelli Sometimes I think 'outgoing' transactions need to be in a special section of the wallet. A bit like how mail programs have an 'outbox'. Newly created transactions will end up there, and are removed after trying to broadcast for a while - or when the user wants to give up on them.

It would be better than considering all transactions for rebroadcast. At the least it would give the user explicit control over that.

In any case, it doesn't need to block this sensible privacy improvement, but I agree that the rebroadcast logic is still far from optimal.

LogPrintf("Relaying wtx %s\n", GetHash().ToString());
RelayTransaction((CTransaction)*this);
return true;
Expand Down