bitcoin/src/util
laanwj 0ea92cad52
Merge bitcoin/bitcoin#24356: refactor: replace CConnman::SocketEvents() with mockable Sock::WaitMany()
6e68ccbefe net: use Sock::WaitMany() instead of CConnman::SocketEvents() (Vasil Dimov)
ae263460ba net: introduce Sock::WaitMany() (Vasil Dimov)
cc74459768 net: also wait for exceptional events in Sock::Wait() (Vasil Dimov)

Pull request description:

  _This is a piece of #21878, chopped off to ease review._

  `Sock::Wait()` waits for IO events on one socket. Introduce a similar `virtual` method `WaitMany()` that waits simultaneously for IO events on more than one socket.

  Use `WaitMany()` instead of `CConnman::SocketEvents()` (and ditch the latter). Given that the former is a `virtual` method, it can be mocked by unit and fuzz tests. This will help to make bigger parts of `CConnman` testable (unit and fuzz).

ACKs for top commit:
  laanwj:
    Code review ACK 6e68ccbefe
  jonatack:
    re-ACK 6e68ccbefe per `git range-diff e18fd47 6747729 6e68ccb`, and verified rebase to master and debug build

Tree-SHA512: 917fb6ad880d64d3af1ebb301c06fbd01afd8ff043f49e4055a088ebed6affb7ffe1dcf59292d822f10de5f323b6d52d557cb081dd7434634995f9148efcf08f
2022-06-16 20:05:03 +02:00
..
asmap.cpp refactor: replace boost::filesystem with std::filesystem 2022-02-03 18:35:52 +08:00
asmap.h scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
bip32.cpp scripted-diff: Bump copyright headers 2020-04-16 13:33:09 -04:00
bip32.h refactor: Remove defunct attributes.h includes 2022-05-21 13:54:33 -05:00
bytevectorhash.cpp refactor: make GetRand a template, remove GetRandInt 2022-04-22 09:04:39 -05:00
bytevectorhash.h
check.cpp util/check: stop using lambda for Assert/Assume 2022-03-30 23:09:13 +10:00
check.h lint: Mention NONFATAL_UNREACHABLE in lint-assertions.py 2022-04-26 10:01:54 +02:00
designator.h Use designated initializers 2022-06-01 20:06:01 +02:00
epochguard.h util, refactor: Add UNIQUE_NAME helper macro 2022-02-16 14:59:20 +02:00
error.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
error.h rpc: send: support external signer 2021-02-23 14:34:32 +01:00
fastrange.h Add FastRange32 function and use it throughout the codebase 2022-01-07 13:37:47 -05:00
fees.cpp scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
fees.h scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
getuniquepath.cpp Disallow more unsafe string->path conversions allowed by path append operators 2022-04-21 12:01:00 -05:00
getuniquepath.h Introduce GetUniquePath(base) helper method to replace boost::filesystem::unique_path() which is not available in std::filesystem. 2021-02-04 11:38:09 +01:00
golombrice.h [moveonly] Move MapIntoRange() to separate util/fastrange.h 2022-01-06 11:27:06 -05:00
hash_type.h move-only: Add util/hash_type 2021-05-11 10:38:18 +02:00
hasher.cpp refactor: make GetRand a template, remove GetRandInt 2022-04-22 09:04:39 -05:00
hasher.h scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
macros.h util, refactor: Add UNIQUE_NAME helper macro 2022-02-16 14:59:20 +02:00
message.cpp Make DecodeBase{32,64} return optional instead of taking bool* 2022-04-27 14:12:55 +02:00
message.h Move direct calls to MessageSign into new SignMessage functions in CWallet and ScriptPubKeyMan 2020-03-09 11:16:20 -04:00
moneystr.cpp scripted-diff: Rename ValidAsCString to ContainsNoNUL 2022-04-27 14:16:35 +02:00
moneystr.h refactor: Remove defunct attributes.h includes 2022-05-21 13:54:33 -05:00
overflow.h util: Add SaturatingAdd helper 2022-02-21 14:32:53 +01:00
overloaded.h refactor: Make CWalletTx sync state type-safe 2021-11-15 09:11:44 -05:00
rbf.cpp scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
rbf.h scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
readwritefile.cpp util: Fix ReadBinaryFile reading beyond maxsize 2022-02-19 18:39:43 +08:00
readwritefile.h scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
serfloat.cpp Add platform-independent float encoder/decoder 2021-05-24 16:04:44 -07:00
serfloat.h Add platform-independent float encoder/decoder 2021-05-24 16:04:44 -07:00
settings.cpp settings: Add update/getPersistent/isIgnored methods 2022-05-19 11:32:56 -04:00
settings.h settings: Add update/getPersistent/isIgnored methods 2022-05-19 11:32:56 -04:00
sock.cpp net: introduce Sock::WaitMany() 2022-06-09 14:20:18 +02:00
sock.h net: introduce Sock::WaitMany() 2022-06-09 14:20:18 +02:00
spanparsing.cpp refactor: introduce single-separator split helper SplitString 2022-04-11 22:19:46 +02:00
spanparsing.h Extend Split to work with multiple separators 2022-05-04 07:34:47 +02:00
strencodings.cpp Merge bitcoin/bitcoin#23595: util: Add ParseHex<std::byte>() helper 2022-05-20 10:47:30 +02:00
strencodings.h refactor: Remove defunct attributes.h includes 2022-05-21 13:54:33 -05:00
string.cpp Wrap boost::replace_all 2022-05-05 20:50:24 +02:00
string.h Wrap boost::replace_all 2022-05-05 20:50:24 +02:00
syscall_sandbox.cpp Remove gui-only syscalls 2022-04-05 13:30:06 +02:00
syscall_sandbox.h init: Disable syscall sandbox in the bitcoin-qt process 2022-04-05 13:29:42 +02:00
syserror.cpp util: Increase buffer size to 1024 in SysErrorString 2022-04-28 10:24:06 +02:00
syserror.h util: Replace non-threadsafe strerror 2022-04-28 10:24:06 +02:00
system.cpp Merge bitcoin/bitcoin#24931: Strengthen thread safety assertions 2022-06-10 16:42:53 +02:00
system.h Merge bitcoin/bitcoin#15936: interfaces: Expose settings.json methods to GUI 2022-05-26 17:05:10 +02:00
thread.cpp refactor: Make TraceThread a non-template free function 2021-04-25 12:28:44 +03:00
thread.h refactor: Make TraceThread a non-template free function 2021-04-25 12:28:44 +03:00
threadnames.cpp refactor: add missing std:: includes to threadnames.cpp 2022-04-01 14:49:13 +01:00
threadnames.h scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
time.cpp Add mockable clock type and TicksSinceEpoch helper 2022-05-18 18:58:05 +02:00
time.h doc: Fix spelling errors identified by codespell in coments 2022-05-25 00:26:21 -05:00
tokenpipe.cpp Guard #include <config/bitcoin-config.h> 2022-05-02 16:41:30 +02:00
tokenpipe.h util: Add RAII TokenPipe 2021-03-04 18:24:00 +01:00
trace.h scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
translation.h scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
types.h Add util/types.h with ALWAYS_FALSE template 2021-09-07 19:19:02 +02:00
ui_change_type.h wallet: Do not include server symbols 2020-06-27 11:39:09 -04:00
url.cpp scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
url.h scripted-diff: Bump copyright headers 2020-04-16 13:33:09 -04:00
vector.h