MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / Modify

Method Modify

src/txrequest.cpp:377–385  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

375 //! Wrapper around Index::...::modify that keeps m_peerinfo up to date.
376 template<typename Tag, typename Modifier>
377 void Modify(Iter<Tag> it, Modifier modifier)
378 {
379 auto peerit = m_peerinfo.find(it->m_peer);
380 peerit->second.m_completed -= it->GetState() == State::COMPLETED;
381 peerit->second.m_requested -= it->GetState() == State::REQUESTED;
382 m_index.get<Tag>().modify(it, std::move(modifier));
383 peerit->second.m_completed += it->GetState() == State::COMPLETED;
384 peerit->second.m_requested += it->GetState() == State::REQUESTED;
385 }
386
387 //! Convert a CANDIDATE_DELAYED announcement into a CANDIDATE_READY. If this makes it the new best
388 //! CANDIDATE_READY (and no REQUESTED exists) and better than the CANDIDATE_BEST (if any), it becomes the new

Callers

nothing calls this directly

Calls 2

findMethod · 0.80
GetStateMethod · 0.45

Tested by

no test coverage detected