Merge #9290: Make RelayWalletTransaction attempt to AcceptToMemoryPool.

f692fce Make RelayWalletTransaction attempt to AcceptToMemoryPool. (Gregory Maxwell)
This commit is contained in:
Pieter Wuille 2016-12-14 01:26:39 -08:00
commit 57e337d40e
No known key found for this signature in database
GPG Key ID: DBA1A67379A1A931

View File

@ -1542,9 +1542,11 @@ void CWallet::ReacceptWalletTransactions()
bool CWalletTx::RelayWalletTransaction(CConnman* connman) bool CWalletTx::RelayWalletTransaction(CConnman* connman)
{ {
assert(pwallet->GetBroadcastTransactions()); assert(pwallet->GetBroadcastTransactions());
if (!IsCoinBase()) if (!IsCoinBase() && !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()); LogPrintf("Relaying wtx %s\n", GetHash().ToString());
if (connman) { if (connman) {
CInv inv(MSG_TX, GetHash()); CInv inv(MSG_TX, GetHash());