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

Method SetBlockHash

src/SHAHashSet.cpp:255–274  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

253
254
255void CAICHHashTree::SetBlockHash(uint64 nSize, uint64 nStartPos, CAICHHashAlgo* pHashAlg)
256{
257 wxASSERT ( nSize <= EMBLOCKSIZE );
258 CAICHHashTree* pToInsert = FindHash(nStartPos, nSize);
259 if (pToInsert == NULL) { // sanity
260 wxFAIL;
261 AddDebugLogLineN(logSHAHashSet, "Critical Error: Failed to Insert SHA-HashBlock, FindHash() failed!");
262 return;
263 }
264
265 //sanity
266 if (pToInsert->m_nBaseSize != EMBLOCKSIZE || pToInsert->m_nDataSize != nSize) {
267 wxFAIL;
268 AddDebugLogLineN(logSHAHashSet, "Critical Error: Logical error on values in SetBlockHashFromData");
269 return;
270 }
271
272 pHashAlg->Finish(pToInsert->m_Hash);
273 pToInsert->m_bHashValid = true;
274}
275
276
277bool CAICHHashTree::CreatePartRecoveryData(uint64 nStartPos, uint64 nSize, CFileDataIO* fileDataOut, uint32 wHashIdent, bool b32BitIdent)

Callers 1

CreateHashFromInputMethod · 0.80

Calls 1

FinishMethod · 0.45

Tested by

no test coverage detected