Introduce a new “check alias” helper for RPC commands, which checks and moves the values into the “primary” key.
The first commit simply pushKV
’s the value from the alias, if set, whereas the second commit const-casts the keys vector in UniValue and modifies that directly, i.e. “rename”. Some people (cough sipa cough) might object to the approach, so I’m splitting into two commits.
This is partially also a cleanup of #16378.