| 1729 | } |
| 1730 | |
| 1731 | void CWallet::ReacceptWalletTransactions() |
| 1732 | { |
| 1733 | // If transactions aren't being broadcasted, don't let them into local mempool either |
| 1734 | if (!fBroadcastTransactions) |
| 1735 | return; |
| 1736 | std::map<int64_t, CWalletTx*> mapSorted; |
| 1737 | |
| 1738 | // Sort pending wallet transactions based on their initial wallet insertion order |
| 1739 | for (std::pair<const uint256, CWalletTx>& item : mapWallet) { |
| 1740 | const uint256& wtxid = item.first; |
| 1741 | CWalletTx& wtx = item.second; |
| 1742 | assert(wtx.GetHash() == wtxid); |
| 1743 | |
| 1744 | int nDepth = GetTxDepthInMainChain(wtx); |
| 1745 | |
| 1746 | if (!wtx.IsCoinBase() && (nDepth == 0 && !wtx.isAbandoned())) { |
| 1747 | mapSorted.insert(std::make_pair(wtx.nOrderPos, &wtx)); |
| 1748 | } |
| 1749 | } |
| 1750 | |
| 1751 | // Try to add wallet transactions to memory pool |
| 1752 | for (const std::pair<const int64_t, CWalletTx*>& item : mapSorted) { |
| 1753 | CWalletTx& wtx = *(item.second); |
| 1754 | std::string unused_err_string; |
| 1755 | SubmitTxMemoryPoolAndRelay(wtx, unused_err_string, false); |
| 1756 | } |
| 1757 | } |
| 1758 | |
| 1759 | bool CWallet::SubmitTxMemoryPoolAndRelay(CWalletTx& wtx, std::string& err_string, bool relay) const |
| 1760 | { |
no test coverage detected