MCPcopy Create free account
hub / github.com/PurpleI2P/i2pd / HandlePublishVerificationTimer

Method HandlePublishVerificationTimer

libi2pd/Destination.cpp:707–740  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

705 }
706
707 void LeaseSetDestination::HandlePublishVerificationTimer (const boost::system::error_code& ecode)
708 {
709 if (ecode != boost::asio::error::operation_aborted)
710 {
711 auto ls = GetLeaseSetMt ();
712 if (!ls)
713 {
714 LogPrint (eLogWarning, "Destination: Couldn't verify LeaseSet for ", GetIdentHash().ToBase32());
715 return;
716 }
717 auto s = shared_from_this ();
718 RequestLeaseSet (ls->GetStoreHash (),
719 [s, ls](std::shared_ptr<const i2p::data::LeaseSet> leaseSet)
720 {
721 if (leaseSet)
722 {
723 if (*ls == *leaseSet)
724 {
725 // we got latest LeasetSet
726 LogPrint (eLogDebug, "Destination: Published LeaseSet verified for ", s->GetIdentHash().ToBase32());
727 s->m_PublishVerificationTimer.expires_after (std::chrono::seconds(PUBLISH_REGULAR_VERIFICATION_INTERNAL));
728 s->m_PublishVerificationTimer.async_wait (std::bind (&LeaseSetDestination::HandlePublishVerificationTimer, s, std::placeholders::_1));
729 return;
730 }
731 else
732 LogPrint (eLogDebug, "Destination: LeaseSet is different than just published for ", s->GetIdentHash().ToBase32());
733 }
734 else
735 LogPrint (eLogWarning, "Destination: Couldn't find published LeaseSet for ", s->GetIdentHash().ToBase32());
736 // we have to publish again
737 s->Publish ();
738 });
739 }
740 }
741
742 void LeaseSetDestination::HandlePublishDelayTimer (const boost::system::error_code& ecode)
743 {

Callers

nothing calls this directly

Calls 4

LogPrintFunction · 0.85
RequestLeaseSetFunction · 0.85
GetStoreHashMethod · 0.80
PublishMethod · 0.45

Tested by

no test coverage detected