Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/avalanche.cpp
Show First 20 Lines • Show All 63 Lines • ▼ Show 20 Lines | if ((keyHex.length() != 2 * CPubKey::COMPRESSED_PUBLIC_KEY_SIZE && | ||||
keyHex.length() != 2 * CPubKey::PUBLIC_KEY_SIZE) || | keyHex.length() != 2 * CPubKey::PUBLIC_KEY_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)); | ||||
} | } | ||||
CPubKey pubkey{HexToPubKey(keyHex)}; | CPubKey pubkey{HexToPubKey(keyHex)}; | ||||
g_avalanche->addPeer(nodeid, 0, pubkey); | g_avalanche->addPeer(nodeid, 100, pubkey); | ||||
return {}; | return {}; | ||||
} | } | ||||
// clang-format off | // clang-format off | ||||
static const CRPCCommand commands[] = { | static const CRPCCommand commands[] = { | ||||
// category name actor (function) argNames | // category name actor (function) argNames | ||||
// ------------------- ------------------------ ---------------------- ---------- | // ------------------- ------------------------ ---------------------- ---------- | ||||
{ "avalanche", "getavalanchekey", getavalanchekey, {}}, | { "avalanche", "getavalanchekey", getavalanchekey, {}}, | ||||
Show All 9 Lines |