Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/avalanche.cpp
Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | if ((keyHex.length() != 2 * CPubKey::COMPRESSED_SIZE && | ||||
!IsHex(keyHex)) { | !IsHex(keyHex)) { | ||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, | throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, | ||||
strprintf("Invalid public key: %s\n", keyHex)); | strprintf("Invalid public key: %s\n", keyHex)); | ||||
} | } | ||||
return HexToPubKey(keyHex); | return HexToPubKey(keyHex); | ||||
} | } | ||||
static bool registerProofIfNeeded(std::shared_ptr<avalanche::Proof> proof) { | static bool registerProofIfNeeded(avalanche::ProofRef proof) { | ||||
return g_avalanche->withPeerManager([&](avalanche::PeerManager &pm) { | return g_avalanche->withPeerManager([&](avalanche::PeerManager &pm) { | ||||
return pm.getProof(proof->getId()) || | return pm.getProof(proof->getId()) || | ||||
pm.registerProof(std::move(proof)); | pm.registerProof(std::move(proof)); | ||||
}); | }); | ||||
} | } | ||||
static void verifyDelegationOrThrow(avalanche::Delegation &dg, | static void verifyDelegationOrThrow(avalanche::Delegation &dg, | ||||
const std::string &dgHex, CPubKey &auth) { | const std::string &dgHex, CPubKey &auth) { | ||||
▲ Show 20 Lines • Show All 632 Lines • Show Last 20 Lines |