MCPcopy Create free account
hub / github.com/ElementsProject/elements / ReacceptWalletTransactions

Method ReacceptWalletTransactions

src/wallet/wallet.cpp:1731–1757  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1729}
1730
1731void 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
1759bool CWallet::SubmitTxMemoryPoolAndRelay(CWalletTx& wtx, std::string& err_string, bool relay) const
1760{

Callers 4

importaddressFunction · 0.80
importpubkeyFunction · 0.80
importmultiFunction · 0.80
importdescriptorsFunction · 0.80

Calls 4

isAbandonedMethod · 0.80
GetHashMethod · 0.45
IsCoinBaseMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected