@@ -1681,7 +1681,7 @@ void CWallet::ReacceptWalletTransactions()
16811681 }
16821682}
16831683
1684- bool CWalletTx::RelayWalletTransaction (ipc::Chain::LockedState& ipc_locked, CConnman* connman )
1684+ bool CWalletTx::RelayWalletTransaction (ipc::Chain::LockedState& ipc_locked)
16851685{
16861686 assert (pwallet->GetBroadcastTransactions ());
16871687 if (!IsCoinBase () && !isAbandoned () && GetDepthInMainChain (ipc_locked) == 0 )
@@ -1690,12 +1690,7 @@ bool CWalletTx::RelayWalletTransaction(ipc::Chain::LockedState& ipc_locked, CCon
16901690 /* GetDepthInMainChain already catches known conflicts. */
16911691 if (InMempool () || AcceptToMemoryPool (ipc_locked, state)) {
16921692 LogPrintf (" Relaying wtx %s\n " , GetHash ().ToString ());
1693- if (connman) {
1694- CInv inv (MSG_TX, GetHash ());
1695- connman->ForEachNode ([&inv](CNode* pnode)
1696- {
1697- pnode->PushInventory (inv);
1698- });
1693+ if (pwallet->ipc_chain ().relayTransaction (GetHash ())) {
16991694 return true ;
17001695 }
17011696 }
@@ -1920,7 +1915,7 @@ bool CWalletTx::IsEquivalentTo(const CWalletTx& _tx) const
19201915 return CTransaction (tx1) == CTransaction (tx2);
19211916}
19221917
1923- std::vector<uint256> CWallet::ResendWalletTransactionsBefore (ipc::Chain::LockedState& ipc_locked, int64_t nTime, CConnman* connman )
1918+ std::vector<uint256> CWallet::ResendWalletTransactionsBefore (ipc::Chain::LockedState& ipc_locked, int64_t nTime)
19241919{
19251920 std::vector<uint256> result;
19261921
@@ -1939,7 +1934,7 @@ std::vector<uint256> CWallet::ResendWalletTransactionsBefore(ipc::Chain::LockedS
19391934 for (std::pair<const unsigned int , CWalletTx*>& item : mapSorted)
19401935 {
19411936 CWalletTx& wtx = *item.second ;
1942- if (wtx.RelayWalletTransaction (ipc_locked, connman ))
1937+ if (wtx.RelayWalletTransaction (ipc_locked))
19431938 result.push_back (wtx.GetHash ());
19441939 }
19451940 return result;
@@ -1964,7 +1959,7 @@ void CWallet::ResendWalletTransactions(int64_t nBestBlockTime, CConnman* connman
19641959 // Rebroadcast unconfirmed txes older than 5 minutes before the last
19651960 // block was found:
19661961 auto ipc_locked = m_ipc_chain->assumeLocked (); // Temporary. Removed in upcoming lock cleanup
1967- std::vector<uint256> relayed = ResendWalletTransactionsBefore (*ipc_locked, nBestBlockTime-5 *60 , connman );
1962+ std::vector<uint256> relayed = ResendWalletTransactionsBefore (*ipc_locked, nBestBlockTime-5 *60 );
19681963 if (!relayed.empty ())
19691964 LogPrintf (" %s: rebroadcast %u unconfirmed transactions\n " , __func__, relayed.size ());
19701965}
@@ -2973,7 +2968,7 @@ bool CWallet::CreateTransaction(ipc::Chain::LockedState& ipc_locked, const std::
29732968/* *
29742969 * Call after CreateTransaction unless you want to abort
29752970 */
2976- bool CWallet::CommitTransaction (CWalletTx& wtxNew, CReserveKey& reservekey, CConnman* connman, CValidationState& state)
2971+ bool CWallet::CommitTransaction (CWalletTx& wtxNew, CReserveKey& reservekey, CValidationState& state)
29772972{
29782973 {
29792974 auto ipc_locked = m_ipc_chain->lockState ();
@@ -3010,7 +3005,7 @@ bool CWallet::CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey, CCon
30103005 LogPrintf (" CommitTransaction(): Transaction cannot be broadcast immediately, %s\n " , state.GetRejectReason ());
30113006 // TODO: if we expect the failure to be long term or permanent, instead delete wtx from the wallet and return failure.
30123007 } else {
3013- wtx.RelayWalletTransaction (*ipc_locked, connman );
3008+ wtx.RelayWalletTransaction (*ipc_locked);
30143009 }
30153010 }
30163011 }
0 commit comments