MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / ReacceptWalletTransactions

Method ReacceptWalletTransactions

src/wallet/wallet.cpp:1797–1825  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1795}
1796
1797void 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
1827bool CWalletTx::RelayWalletTransaction(CConnman* connman)
1828{

Callers 3

importaddressFunction · 0.80
importpubkeyFunction · 0.80
importmultiFunction · 0.80

Calls 6

GetDepthInMainChainMethod · 0.80
isAbandonedMethod · 0.80
AcceptToMemoryPoolMethod · 0.80
GetHashMethod · 0.45
IsCoinBaseMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected