Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/avalanche.cpp
Show First 20 Lines • Show All 264 Lines • ▼ Show 20 Lines | if (request.params.size() >= 4 && !request.params[3].isNull()) { | ||||
ss >> dg; | ss >> dg; | ||||
avalanche::DelegationState dgState; | avalanche::DelegationState dgState; | ||||
if (!dg.verify(dgState, proof, auth)) { | if (!dg.verify(dgState, proof, auth)) { | ||||
throw JSONRPCError(RPC_INVALID_PARAMETER, | throw JSONRPCError(RPC_INVALID_PARAMETER, | ||||
"The supplied delegation is not valid"); | "The supplied delegation is not valid"); | ||||
} | } | ||||
if (!dgb.importDelegation(dg)) { | if (!dgb.importDelegation(dg, auth)) { | ||||
throw JSONRPCError(RPC_INVALID_PARAMETER, | throw JSONRPCError(RPC_INVALID_PARAMETER, | ||||
"The supplied delegation is not valid"); | "The supplied delegation is not valid"); | ||||
} | } | ||||
} else { | } else { | ||||
auth = proof.getMaster(); | auth = proof.getMaster(); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 136 Lines • Show Last 20 Lines |