Page MenuHomePhabricator

rpc, refactor: clean-up `addnode`
ClosedPublic

Authored by PiRK on Thu, Apr 17, 15:12.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC159c0dc33237: rpc, refactor: clean-up `addnode`
Summary
  1. Use const where possible;
  2. Rename variables to make them clearer;
  3. There is no need to check whether command is null since it's a non-optional field.

Test that addnode with an invalid command should throw an error.

Make it clear in the doc that node in addnode refers to the node's address.

This is a backport of core#26366

Test Plan

ninja all check-all

Event Timeline

PiRK requested review of this revision.Thu, Apr 17, 15:12
Fabien added inline comments.
src/rpc/net.cpp
367

const auto command = Arg<std::string>(1);

376

const auto node_arg = Arg<std::string>(0);

This revision is now accepted and ready to land.Thu, Apr 17, 18:29
This revision was automatically updated to reflect the committed changes.