Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/delegationbuilder.cpp
Show All 31 Lines | for (auto &l : d.levels) { | ||||
levels.back().sig = l.sig; | levels.back().sig = l.sig; | ||||
levels.push_back({l.pubkey, {}}); | levels.push_back({l.pubkey, {}}); | ||||
} | } | ||||
return true; | return true; | ||||
} | } | ||||
bool DelegationBuilder::addLevel(const CKey &key, const CPubKey &master) { | bool DelegationBuilder::addLevel(const CKey &key, const CPubKey &master) { | ||||
// Ensures that the private key provided is the one we need. | // Ensures that the private key provided is the one we need and we're not | ||||
if (levels.back().pubkey != key.GetPubKey()) { | // delegating to the same public key. | ||||
const CPubKey ¤tPubKey = levels.back().pubkey; | |||||
if (currentPubKey != key.GetPubKey() || currentPubKey == master) { | |||||
deadalnix: I don't think this is solving any problem, just adding special cases. | |||||
return false; | return false; | ||||
} | } | ||||
CHashWriter ss(SER_GETHASH, 0); | CHashWriter ss(SER_GETHASH, 0); | ||||
ss << dgid; | ss << dgid; | ||||
ss << master; | ss << master; | ||||
auto hash = ss.GetHash(); | auto hash = ss.GetHash(); | ||||
Show All 19 Lines |
I don't think this is solving any problem, just adding special cases.