diff options
| author | bitflash-maintainer <noreply@bitflash.invalid> | 2026-09-01 17:14:12 +0000 |
|---|---|---|
| committer | bitflash-maintainer <noreply@bitflash.invalid> | 2026-09-01 17:14:12 +0000 |
| commit | b4f0bc693ef7175702f82bcb2110b627922e8cbd (patch) | |
| tree | 73435feb1a076dfba94d8143d7d7b7784908c82f /src/net.h | |
| parent | a1d867ecbcfc9e218408d0a11863a450243a01f9 (diff) | |
| parent | 6aa3dade77632f13189d2a3ef29897f29a5f9572 (diff) | |
Merge upstream v1.2.20 into the fork
Merges upstream tag v1.2.20 (6aa3dade) into our 1.2.19+sec tree. The merge
base is bc3de30's descendant 9e39a50 -- upstream's own v1.2.19 -- so this is
an ordinary three-way merge, not a replay. Five conflict blocks in four
files, all resolved below.
No consensus change. CheckBlock, ConnectBlock, DisconnectBlock, ConnectInputs,
AcceptBlock, AcceptTransaction, GetNextWorkRequired and GetBlockValue hash
identical to v1.2.19; script.cpp and script.h are byte-identical on both
sides. main.cpp is +3 lines and main.h +2, all wallet-backend plumbing.
rpc.cpp is untouched, so the payout ledger arrives unchanged.
Makefile, VERSION. OURS, renumbered. 1.2.20+sec, for the same reason 1.2.19
carried +sec: this tree is not the upstream release of that number and the
string names every release artifact.
Makefile, AppImage recipe. OURS for the AppDir path, THEIRS for the bundled
library. Upstream's hunk reverts the icon paths to a hardcoded
/tmp/bitflash.AppDir, which is the local-user pre-placement hazard the fork
moved out of /tmp in the first place; taking their side wholesale would have
reintroduced it silently, inside a conflict about something else. The AppDir
stays $(APPDIR), and libsqlite3.so.0 joins the bundled list, which the new
backend genuinely needs.
src/Makefile, src/makefile.mingw, HEADERS. BOTH. Ours drops market.h,
theirs adds wallet_sqlite.h; the resolution does both. NODE_OBJS auto-merged
correctly in both files -- obj/wallet_sqlite.o present, obj/market.o still
gone -- and was verified rather than assumed, because that line has trapped
this fork before.
src/selftest.cpp, known-tests list. BOTH, union. Upstream adds eight
wallet-storage tests, we keep payout-ledger. The dispatch chain itself
auto-merged and still routes payout-ledger to RunPayoutLedgerSelfTest.
Hardening verified intact after merge: the TLS 1.2 floor in nostr.cpp, the
/rvrelay pin, opt-in managed Tor, strict sig3-on-onion descriptor
verification, and the marketplace removal. Upstream shipped no build logs or
__pycache__ this time; the three added files are docs/storage.md and
src/wallet_sqlite.{cpp,h}.
The SQLite backend this release introduces is NOT enabled here. An existing
wallet.dat resolves to Berkeley DB on every branch of the new selection
logic, and the conversion wizard is GUI-only and not compiled into the
headless node. The review findings that gate ever turning it on -- the
non-atomic backend marker, the connection-wide WriteHDMaster transaction,
and the encrypt-swap crash window -- are recorded on the tracker, not fixed
here.
Diffstat (limited to 'src/net.h')
| -rw-r--r-- | src/net.h | 17 |
1 files changed, 17 insertions, 0 deletions
| @@ -109,6 +109,23 @@ static const unsigned int MAX_PROTOCOL_MESSAGE_SIZE = MAX_SIZE; | |||
| 109 | // 125 is Bitcoin's number and remains a conservative public-node default. | 109 | // 125 is Bitcoin's number and remains a conservative public-node default. |
| 110 | static const unsigned int MAX_CONNECTIONS = 125; | 110 | static const unsigned int MAX_CONNECTIONS = 125; |
| 111 | 111 | ||
| 112 | // Cap inbound connections from any single address. Without it one source can | ||
| 113 | // hold every slot up to MAX_CONNECTIONS -- exactly what happened to the | ||
| 114 | // rendezvous relays, where a single IP parked hundreds of connections and | ||
| 115 | // starved real peers. A legitimate peer, even a relay talking to a relay, | ||
| 116 | // needs only a handful; 32 leaves generous room while denying any one address | ||
| 117 | // more than a quarter of the table. The firewall connlimit on the relays does | ||
| 118 | // the same thing a layer lower; this makes every build carry the defense. | ||
| 119 | // | ||
| 120 | // Loopback (127.0.0.0/8) is exempt in the accept path. A managed-Tor node | ||
| 121 | // receives every inbound onion peer over its local hidden-service listener, so | ||
| 122 | // they all appear as 127.0.0.1 -- capping loopback would cap onion peers as a | ||
| 123 | // group, which is exactly wrong for a network moving toward onion-only. The | ||
| 124 | // global MAX_CONNECTIONS still bounds the total; a per-onion-identity limit, | ||
| 125 | // applied once identity is known after accept(), is the right future tool for | ||
| 126 | // onion floods. | ||
| 127 | static const unsigned int MAX_CONNECTIONS_PER_IP = 32; | ||
| 128 | |||
| 112 | // A node marked for disconnect is normally held until its buffers drain, so | 129 | // A node marked for disconnect is normally held until its buffers drain, so |
| 113 | // a last message still goes out. But vSend cannot drain through a socket | 130 | // a last message still goes out. But vSend cannot drain through a socket |
| 114 | // whose far end is gone, and that made such a node immortal: it stayed in | 131 | // whose far end is gone, and that made such a node immortal: it stayed in |