Page MenuHomePhabricator

rpc, refactor: clean-up `addnode`
ClosedPublic

Authored by PiRK on Apr 17 2025, 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

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

PiRK requested review of this revision.Apr 17 2025, 15:12
Fabien added inline comments.
src/rpc/net.cpp
367 ↗(On Diff #53536)

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

376 ↗(On Diff #53536)

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

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