MCPcopy Create free account
hub / github.com/WaykiChain/WaykiChain / ThreadRelayTx

Function ThreadRelayTx

src/wallet/walletdb.cpp:410–426  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

408}
409
410void ThreadRelayTx(CWallet* pWallet) {
411 RenameThread("coin-relaytx");
412 while (pWallet) {
413 MilliSleep(60 * 1000);
414 map<uint256, std::shared_ptr<CBaseTx> > relayTxMap;
415 {
416 LOCK(pWallet->cs_wallet);
417 relayTxMap = pWallet->unconfirmedTx; // copy the tx map to avoid cycle thread lock
418 }
419 for (auto item : relayTxMap) {
420 if (mempool.Exists(item.first)) {
421 RelayTransaction(item.second.get(), item.first);
422 LogPrint(BCLog::NET, "ThreadRelayTx resend tx hash:%s time:%ld\n", item.first.GetHex(), GetTime());
423 }
424 }
425 }
426}
427
428bool BackupWallet(const CWallet& wallet, const string& strDest) {
429 while (true) {

Callers

nothing calls this directly

Calls 7

RenameThreadFunction · 0.85
MilliSleepFunction · 0.85
RelayTransactionFunction · 0.85
GetTimeFunction · 0.85
ExistsMethod · 0.45
getMethod · 0.45
GetHexMethod · 0.45

Tested by

no test coverage detected