aboutsummaryrefslogtreecommitdiff
path: root/src/qt/paymentserver.cpp
diff options
context:
space:
mode:
authorJon Atack <jon@atack.com>2021-04-09 20:13:52 +0200
committerMarcoFalke <falke.marco@gmail.com>2021-05-22 09:58:26 +0200
commitf2a88986a18f197f6a4690f5dcca248f6b6170e2 (patch)
tree78321fb824923d387d85425cb673f5794dfd8096 /src/qt/paymentserver.cpp
parent58c07426326dd047c5fec8b4c1037b9c0da7a191 (diff)
downloadbitcoin-f2a88986a18f197f6a4690f5dcca248f6b6170e2.tar.xz
p2p, bugfix: use NetPermissions::HasFlag() in CConnman::Bind()
PF_NOBAN is a multi-flag that includes PF_DOWNLOAD, so the conditional in CConnman::Bind() using a bitwise AND will return the same result for both the "noban" status and the "download" status. Example: `PF_DOWNLOAD` is `0b1000000` `PF_NOBAN` is `0b1010000` This makes a check like `flags & PF_NOBAN` return `true` even if `flags` is equal to `PF_DOWNLOAD`. If `-whitebind=download@1.1.1.1:8765` is specified, then `1.1.1.1:8765` should be added to the list of local addresses. We only want to avoid adding to local addresses (that are advertised) a whitebind that has a `noban@` flag. As a result of a mis-check in `CConnman::Bind()` we would not have added `1.1.1.1:8765` to the local addresses in the example above. Co-authored-by: Vasil Dimov <vd@FreeBSD.org> Github-Pull: bitcoin/bitcoin#21644 Rebased-From: dde69f20a01acca64ac21cb13993c6e4f8709f23
Diffstat (limited to 'src/qt/paymentserver.cpp')
0 files changed, 0 insertions, 0 deletions