MCPcopy Create free account
hub / github.com/amule-project/amule / IsPartDataAvailable

Method IsPartDataAvailable

src/SHAHashSet.cpp:1060–1074  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1058}
1059
1060bool CAICHHashSet::IsPartDataAvailable(uint64 nPartStartPos)
1061{
1062 if (!(m_eStatus == AICH_VERIFIED || m_eStatus == AICH_TRUSTED || m_eStatus == AICH_HASHSETCOMPLETE) ) {
1063 wxFAIL;
1064 return false;
1065 }
1066 uint64 nPartSize = min<uint64>(PARTSIZE, m_pOwner->GetFileSize()-nPartStartPos);
1067 for (uint64 nPartPos = 0; nPartPos < nPartSize; nPartPos += EMBLOCKSIZE) {
1068 CAICHHashTree* phtToCheck = m_pHashTree.FindHash(nPartStartPos+nPartPos, min<uint64>(EMBLOCKSIZE, nPartSize-nPartPos));
1069 if (phtToCheck == NULL || !phtToCheck->m_bHashValid) {
1070 return false;
1071 }
1072 }
1073 return true;
1074}
1075
1076// VC++ defines Assert as ASSERT. VC++ also defines VERIFY MACRO, which is the equivalent of ASSERT but also works in Released builds.
1077

Callers 1

RequestAICHRecoveryMethod · 0.80

Calls 2

GetFileSizeMethod · 0.45
FindHashMethod · 0.45

Tested by

no test coverage detected