Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/processor.cpp
Show First 20 Lines • Show All 537 Lines • ▼ Show 20 Lines | uint256 Processor::buildLocalSighash(CNode *pfrom) const { | ||||
hasher << peerData->delegation.getId(); | hasher << peerData->delegation.getId(); | ||||
hasher << pfrom->GetLocalNonce(); | hasher << pfrom->GetLocalNonce(); | ||||
hasher << pfrom->nRemoteHostNonce; | hasher << pfrom->nRemoteHostNonce; | ||||
hasher << pfrom->GetLocalExtraEntropy(); | hasher << pfrom->GetLocalExtraEntropy(); | ||||
hasher << pfrom->nRemoteExtraEntropy; | hasher << pfrom->nRemoteExtraEntropy; | ||||
return hasher.GetHash(); | return hasher.GetHash(); | ||||
} | } | ||||
uint256 Processor::buildRemoteSighash(CNode *pfrom) const { | |||||
CHashWriter hasher(SER_GETHASH, 0); | |||||
hasher << pfrom->m_avalanche_state->delegation.getId(); | |||||
hasher << pfrom->nRemoteHostNonce; | |||||
hasher << pfrom->GetLocalNonce(); | |||||
hasher << pfrom->nRemoteExtraEntropy; | |||||
hasher << pfrom->GetLocalExtraEntropy(); | |||||
return hasher.GetHash(); | |||||
} | |||||
bool Processor::sendHello(CNode *pfrom) const { | bool Processor::sendHello(CNode *pfrom) const { | ||||
if (!peerData) { | if (!peerData) { | ||||
// We do not have a delegation to advertise. | // We do not have a delegation to advertise. | ||||
return false; | return false; | ||||
} | } | ||||
// Now let's sign! | // Now let's sign! | ||||
SchnorrSig sig; | SchnorrSig sig; | ||||
▲ Show 20 Lines • Show All 234 Lines • Show Last 20 Lines |