There is no significant benefit in logging the request count instead
of the connection count. Reduces amount of code and computational
complexity.
Github-Pull: #28551
Rebased-From: 084d037231
Introduces and uses a HTTPRequestTracker class to keep track of
how many HTTP requests are currently active, so we don't stop the
server before they're all handled.
This has two purposes:
1. In a next commit, allows us to untrack all requests associated
with a connection without running into lifetime issues of the
connection living longer than the request
(see https://github.com/bitcoin/bitcoin/pull/27909#discussion_r1265614783)
2. Improve encapsulation by making the mutex and cv internal members,
and exposing just the WaitUntilEmpty() method that can be safely
used.
Github-Pull: #28551
Rebased-From: 41f9027813
By moving the appMenuBar destruction responsibility to the QT
framework, we ensure the disconnection of the submenus signals
prior to the destruction of the main app window.
The standalone menu bar may have served a purpose in earlier
versions when it didn't contain actions that directly open
specific screens within the main application window. However,
at present, all the actions within the appMenuBar lead to the
opening of screens within the main app window. So, the absence
of a main app window makes these actions essentially pointless.
Github-Pull: gui#751
Rebased-From: bae209e387
As the 'QMenuBar' is created without a parent window in MacOS, the
app crashes when the user presses the shutdown button and, right
after it, triggers any action in the menu bar.
This happens because the QMenuBar is manually deleted in the
BitcoinGUI destructor but the events attached to it children
actions are not disconnected, so QActions events such us the
'QMenu::aboutToShow' could try to access null pointers.
Instead of guarding every single QAction pointer inside the
QMenu::aboutToShow slot, or manually disconnecting all
registered events in the destructor, we can check if a
shutdown was requested and discard the event.
The 'node' field is a ref whose memory is held by the
main application class, so it is safe to use here. Events
are disconnected prior destructing the main application object.
Furthermore, the 'MacDockIconHandler::dockIconClicked' signal
can make the app crash during shutdown for the very same
reason. The 'show()' call triggers the 'QApplication::focusWindowChanged'
event, which is connected to the 'minimize_action' QAction,
which is also part of the app menu bar, which could no longer exist.
Github-Pull: gui#751
Rebased-From: e14cc8fc69
Loading a wallet with conflicts without a chain (e.g. wallet tool and
migration) would previously result in an assertion due to -1 being both
a valid number of conflict confirmations, and the indicator that that
member has not been set yet.
Github-Pull: #28542
Rebased-From: 782701ce7d
MarkConflicted calculates conflict confirmations incorrectly when both
the last block processed height and the conflicting height are negative
(i.e. uninitialized). If either are negative, we should not be marking
conflicts and should exit early.
Github-Pull: #28542
Rebased-From: 4660fc82a1
This commit adds tests to ensure that old fee_estimates.dat files
are not read and that fee_estimates are periodically flushed to the
fee_estimates.dat file.
Additionaly it tests the -regtestonly option -acceptstalefeeestimates.
Github-Pull: #27622
Rebased-From: d2b39e09bc
If -acceptstalefeeestimates option is passed stale fee estimates can now
be read when operating in regtest environments.
Additionally, this commit updates all declarations of the CBlockPolicyEstimator
class to include a the second constructor variable.
Github-Pull: #27622
Rebased-From: cf219f29f3
Old fee estimates could cause transactions to become stuck in the
mempool. This commit prevents the node from using stale estimates
from an old file.
Github-Pull: #27622
Rebased-From: 3eb241a141
The migration process must skip any invalid script inside the legacy
spkm and all the addressbook records linked to them.
These scripts are not being watched by the current wallet, nor should
be watched by the migrated one.
IsMine() returns ISMINE_NO for them.
Github-Pull: #28125
Rebased-From: 8e7e3e6149
The legacy wallet allowed to import any raw script, without checking if
it was valid or not. Appending it to the watch-only set.
This causes a crash in the migration process because we are only
expecting to find valid scripts inside the legacy spkm.
These stored scripts internally map to `ISMINE_NO` (same as if they
weren't stored at all..).
So we need to check for these special case, and take into account that
the legacy spkm could be storing invalid not watched scripts.
Which, in code words, means IsMineInner() returning IsMineResult::INVALID
for them.
Github-Pull: #28125
Rebased-From: 1de8a2372a
e.g. sh(addr(ADDR)) or sh(raw(HEX)) are invalid descriptors.
Making sh and wsh top level functions to return addr/raw descriptors when
the subscript inference fails.
Github-Pull: #28067
Rebased-From: cc781a2180
addressbook records with no associated label could be
treated as change. And we don't want that for external
addresses.
Github-Pull: #28038
Rebased-From: a277f8357a
b8ad3220a9 Unconditionally return when compact block status == READ_STATUS_FAILED (Greg Sanders)
cdd3de08e3 Add tests for parallel compact block downloads (Greg Sanders)
e66a5cbb56 Support up to 3 parallel compact block txn fetchings (Greg Sanders)
d1a93f5d41 Only request full blocks from the peer we thought had the block in-flight (Greg Sanders)
38e3af9fad Convert mapBlocksInFlight to a multimap (Greg Sanders)
a45159b8e2 Remove nBlocksInFlight (Greg Sanders)
722361e129 alias BlockDownloadMap for mapBlocksInFlight (Greg Sanders)
Pull request description:
Backports:
* https://github.com/bitcoin/bitcoin/pull/27626
* https://github.com/bitcoin/bitcoin/pull/27743
ACKs for top commit:
instagibbs:
utACK b8ad3220a9
ajtowns:
ACK b8ad3220a9 ; confirmed patches are clean cherry-picks from master, and already tested patches prior to 25.0 release
Tree-SHA512: 438901496a5ed927662e62f936e3d1e7ffb727cb235869854983e8e29a68e144eb3bff307d9fc3ae785fb276b67a216b1cce397689252ca49c5d761efc1380ac
A single outbound slot is required, so if the first two slots
are taken by inbound in-flights, the node will reject additional
unless they are coming from outbound.
This means in the case where a fast sybil peer is attempting to
stall out a node, a single high bandwidth outbound peer can
mitigate the attack.
Github-Pull: #27626
Rebased-From: 03423f8bd1
This is a change in behavior so that if for some reason we request a block from a peer, we don't allow an unsolicited CMPCT_BLOCK announcement for that same block to cause a request for a full block from the uninvited peer (as some type of request is already outstanding from the original peer)
Github-Pull: #27626
Rebased-From: 13f9b20b4c
This should avoid a race where the kill is not done when spinning up the
new container. podman stop waits 10 seconds by default.
Github-Pull: #27844
Rebased-From: faaa62754e
9dc5848492 build: disable boost multi index safe mode (willcl-ark)
Pull request description:
Backports https://github.com/bitcoin/bitcoin/pull/27724 to `25.x`.
ACKs for top commit:
stickies-v:
ACK 9dc584849
Tree-SHA512: 5f156424bbd86caac6ace933b807cd62a21067bcfa7f572d6efeff2622ba0b15401038a3b06fe00d84cf62b5d9b8a9e101650d145683a21fa890c18a9c2bd4b6
Disable boost multi index safe mode by default when configuring with
--enable-debug.
This option can cause transactions to take a long time to be accepted
into the mempool under certain conditions; iterator destruction takes
O(n) time vs O(1) as they are stored in a singly linked list. See
27586 for more information.
Re-enable it on the CI builds which previously had it enabled.
Re-enable it on the msan fuzz target so that we have fuzz tasks testing
with it enabeld and disabled in this repo.
Github-Pull: #27724
Rebased-From: 59c8944749
6ee3881551 doc: update release notes for 25.0 (fanquake)
51195ea570 doc: update manual pages for 25.0 (fanquake)
8f7db443e9 build: bump version to v25.0 final (fanquake)
Pull request description:
Final changes for v25.0.
PR for bitcoincore.org is here: https://github.com/bitcoin-core/bitcoincore.org/pull/970.
ACKs for top commit:
dergoegge:
ACK 6ee3881551
Tree-SHA512: 7325e7d2747fbbeaa7efa9ceebfef56121d6866441fc4f3f9e95e67ab8ad7d4e518db4f545c214f1b677eaea84f28c1ea4f790aaf993a20904c76c3592406fd6