| 1795 | } |
| 1796 | |
| 1797 | void CWallet::ReacceptWalletTransactions() |
| 1798 | { |
| 1799 | // If transactions aren't being broadcasted, don't let them into local mempool either |
| 1800 | if (!fBroadcastTransactions) |
| 1801 | return; |
| 1802 | LOCK2(cs_main, cs_wallet); |
| 1803 | std::map<int64_t, CWalletTx*> mapSorted; |
| 1804 | |
| 1805 | // Sort pending wallet transactions based on their initial wallet insertion order |
| 1806 | for (std::pair<const uint256, CWalletTx>& item : mapWallet) |
| 1807 | { |
| 1808 | const uint256& wtxid = item.first; |
| 1809 | CWalletTx& wtx = item.second; |
| 1810 | assert(wtx.GetHash() == wtxid); |
| 1811 | |
| 1812 | int nDepth = wtx.GetDepthInMainChain(); |
| 1813 | |
| 1814 | if (!wtx.IsCoinBase() && (nDepth == 0 && !wtx.isAbandoned())) { |
| 1815 | mapSorted.insert(std::make_pair(wtx.nOrderPos, &wtx)); |
| 1816 | } |
| 1817 | } |
| 1818 | |
| 1819 | // Try to add wallet transactions to memory pool |
| 1820 | for (std::pair<const int64_t, CWalletTx*>& item : mapSorted) { |
| 1821 | CWalletTx& wtx = *(item.second); |
| 1822 | CValidationState state; |
| 1823 | wtx.AcceptToMemoryPool(maxTxFee, state); |
| 1824 | } |
| 1825 | } |
| 1826 | |
| 1827 | bool CWalletTx::RelayWalletTransaction(CConnman* connman) |
| 1828 | { |
no test coverage detected