HomePhabricator

Replace message type literals with protocol.h constants

Authored by nakihito on May 20 2020, 17:37.

Description

Replace message type literals with protocol.h constants

Summary:
No reason to use literals when there exists constant variables that convey the
same information. This reduces the number of places that need to be updated if
a protocol change occurs and makes the code more consistent with the node
software.

sed -i s/\"version\"/NetMsgType::VERSION/g
sed -i s/\"verack\"/NetMsgType::VERACK/g
sed -i s/\"getaddr\"/NetMsgType::GETADDR/g
sed -i s/\"addr\"/NetMsgType::ADDR/g

Test Plan:

ninja
ninja check-bitcoin-seeder
cd src/seeder
grep -rnI \"version\"
grep -rnI \"verack\"
grep -rnI \"getaddr\"
grep -rnI \"addr\"

greping for the literals should return nothing in the seeder directory

Reviewers: O1 Bitcoin ABC, #bitcoin_abc, deadalnix

Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D6182

Details

Committed
nakihitoMay 21 2020, 00:32
Pushed
nakihitoMay 21 2020, 00:32
Reviewer
Restricted Owners Package
Differential Revision
D6182: Replace message type literals with protocol.h constants
Parents
rABCe44e705acc71: [backport#15195] gui: Add close wallet action
Branches
Unknown
Tags
Unknown