0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-09 10:43:19 -05:00
bitcoin-bitcoin-core/src/rpc
MarcoFalke 18cd0888ef
Merge #21328: net, refactor: pass uint16 CService::port as uint16
52dd40a9fe test: add missing netaddress include headers (Jon Atack)
6f09c0f6b5 util: add missing braces and apply clang format to SplitHostPort() (Jon Atack)
2875a764f7 util: add ParseUInt16(), use it in SplitHostPort() (Jon Atack)
6423c8175f p2p, refactor: pass and use uint16_t CService::port as uint16_t (Jon Atack)

Pull request description:

  As noticed during review today in https://github.com/bitcoin/bitcoin/pull/20685#discussion_r584873708 of the upcoming I2P network support, `CService::port` is `uint16_t` but is passed around the codebase and into the ctors as `int`, which causes uneeded conversions and casts. We can avoid these (including in the incoming I2P code without further changes to it) by using ports with the correct type. The remaining conversions are pushed out to the user input boundaries where they can be range-checked and raise with user feedback in the next patch.

ACKs for top commit:
  practicalswift:
    cr ACK 52dd40a9fe: patch looks correct
  MarcoFalke:
    cr ACK 52dd40a9fe
  vasild:
    ACK 52dd40a9fe

Tree-SHA512: 203c1cab3189a206c55ecada77b9548b810281cdc533252b8e3330ae0606b467731c75f730ce9deb07cbaab66facf97e1ffd2051084ff9077cba6750366b0432
2021-03-19 20:47:10 +01:00
..
blockchain.cpp rpc: remove scantxoutset EXPERIMENTAL warning 2021-03-15 10:45:49 +01:00
blockchain.h move-onlyish: break out CreateUTXOSnapshot from dumptxoutset 2021-02-12 07:53:34 -06:00
client.cpp rpc: add external_signer option to createwallet 2021-02-23 14:34:31 +01:00
client.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
mining.cpp Merge #20556: rpc: Properly document return values (submitblock, gettxout, getblocktemplate, scantxoutset) 2021-03-15 15:32:15 +08:00
mining.h rpc: create rpc/mining.h, hoist default max tries values to constant 2020-06-01 15:08:36 +02:00
misc.cpp Merge #18466: rpc: fix invalid parameter error codes for {sign,verify}message RPCs 2021-03-01 11:45:42 +01:00
net.cpp p2p, refactor: pass and use uint16_t CService::port as uint16_t 2021-03-16 19:52:31 +01:00
protocol.h rpc: Add specific error code for "wallet already loaded" 2021-01-25 07:55:35 +01:00
rawtransaction.cpp scripted-diff: remove Optional & nullopt 2021-03-15 10:41:30 +08:00
rawtransaction_util.cpp Don't make "in" parameters look like "out"/"in-out" parameters: pass by ref to const instead of ref to non-const 2020-12-06 00:22:40 +00:00
rawtransaction_util.h Don't make "in" parameters look like "out"/"in-out" parameters: pass by ref to const instead of ref to non-const 2020-12-06 00:22:40 +00:00
register.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
request.cpp scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
request.h Remove pointer cast in CRPCTable::dumpArgMap 2021-01-29 18:15:48 -05:00
server.cpp Remove pointer cast in CRPCTable::dumpArgMap 2021-01-29 18:15:48 -05:00
server.h Remove pointer cast in CRPCTable::dumpArgMap 2021-01-29 18:15:48 -05:00
util.cpp Merge #21035: Remove pointer cast in CRPCTable::dumpArgMap 2021-03-15 10:13:58 +01:00
util.h Merge #21035: Remove pointer cast in CRPCTable::dumpArgMap 2021-03-15 10:13:58 +01:00