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

Method Modify

src/txrequest.cpp:387–395  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

385 //! Wrapper around Index::...::modify that keeps m_peerinfo up to date.
386 template<typename Tag, typename Modifier>
387 void Modify(Iter<Tag> it, Modifier modifier)
388 {
389 auto peerit = m_peerinfo.find(it->m_peer);
390 peerit->second.m_completed -= it->GetState() == State::COMPLETED;
391 peerit->second.m_requested -= it->GetState() == State::REQUESTED;
392 m_index.get<Tag>().modify(it, std::move(modifier));
393 peerit->second.m_completed += it->GetState() == State::COMPLETED;
394 peerit->second.m_requested += it->GetState() == State::REQUESTED;
395 }
396
397 //! Convert a CANDIDATE_DELAYED announcement into a CANDIDATE_READY. If this makes it the new best
398 //! 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.80

Tested by

no test coverage detected