Commit Graph

37921 Commits

Author SHA1 Message Date
pablomartin4btc
722ae7e648 gui: Add wallet name to address book page
Extend addresstablemodel to return the display name from the wallet and
set it to the addressbookpage window title when its  model is set.

Github-Pull: gui#757
Rebased-From: 58c9b50a95
2023-10-17 15:31:28 +00:00
Luke Dashjr
cf1bda10ff Diff-minimise 2023-10-17 03:06:58 +00:00
Jameson Lopp
319e6c2bed Throw error if invalid parameters passed to getnetworkhashps RPC endpoint
Github-Pull: #28554
Rebased-From: 435ff29c5be0bd2ad2e89d9a37ecdb5da7c5d063
2023-10-17 03:06:52 +00:00
Vasil Dimov
4018d9ae69 i2p: destroy the session if we get an unexpected error from the I2P router
From https://geti2p.net/en/docs/api/samv3:

  If SILENT=false was passed, which is the default value, the SAM bridge
  sends the client a ASCII line containing the base64 public destination
  key of the requesting peer

So, `Accept()` is supposed to receive a Base64 encoded destination of
the connecting peer, but if it receives something like this instead:

  STREAM STATUS RESULT=I2P_ERROR MESSAGE="Session was closed"

then destroy the session.

Github-Pull: #28077
Rebased-From: 5c8e15c451
2023-10-17 03:03:23 +00:00
Vasil Dimov
3e316169e2 i2p: also sleep after errors in Accept()
Background:

`Listen()` does:
* if the session is not created yet
  * create the control socket and on it:
  * `HELLO`
  * `SESSION CREATE ID=sessid`
  * leave the control socked opened
* create a new socket and on it:
* `HELLO`
* `STREAM ACCEPT ID=sessid`
* read reply (`STREAM STATUS`)

Then a wait starts, for a peer to connect. When connected,

`Accept()` does:
* on the socket from `STREAM ACCEPT` from `Listen()`: read the
  Base64 identification of the connecting peer

Problem:

The I2P router may be in such a state that this happens in a quick
succession (many times per second, see https://github.com/bitcoin/bitcoin/issues/22759#issuecomment-1609907115):
`Listen()`-succeeds, `Accept()`-fails.

`Accept()` fails because the I2P router sends something that is
not Base64 on the socket:
STREAM STATUS RESULT=I2P_ERROR MESSAGE="Session was closed"

We only sleep after failed `Listen()` because the assumption was that
if `Accept()` fails then the next `Listen()` will also fail.

Solution:

Avoid filling the log with "Error accepting:" messages and sleep also
after a failed `Accept()`.

Extra changes:

* Reset the error waiting time after one successful connection.
  Otherwise the timer will remain high due to problems that have
  vanished long time ago.

* Increment the wait time less aggressively.

Github-Pull: #28077
Rebased-From: 762404a68c
2023-10-17 03:02:15 +00:00
Luke Dashjr
ae74955549 Bugfix: QA/fuzz: Add enumeratesigners to RPC_COMMANDS_SAFE_FOR_FUZZING 2023-10-17 02:54:27 +00:00
Luke Dashjr
b96fa5fa80 Bugfix: QA/fuzz: Add invokedisallowedsyscall to RPC_COMMANDS_NOT_SAFE_FOR_FUZZING 2023-10-17 02:54:26 +00:00
Luke Dashjr
d47d17a620 CI: Disable libbitcoinkernel task (not supported for now) 2023-10-17 02:50:32 +00:00
Luke Dashjr
5926663a86 CI: Disable MSVC task (MSVC is not supported) 2023-10-17 02:50:32 +00:00
Luke Dashjr
00f9adcdf1 ci: Run without self-hosted ci 2023-10-17 02:50:32 +00:00
Luke Dashjr
86125a4dcc tidy: Relax a few bad suggestions 2023-10-17 02:47:45 +00:00
Luke Dashjr
47317cbc93 lint-python: Allow for some style differences 2023-10-17 02:47:45 +00:00
Luke Dashjr
2cc594ad76 lint/python-dead-code: Just warn, but allow 2023-10-17 02:47:45 +00:00
Luke Dashjr
a4baa49bd5 lint/circular-dependencies: Only check for real circular dependencies 2023-10-17 02:47:45 +00:00
Luke Dashjr
b493ed30e9 lint/includes: Ignore duplicate includes in .cpp files 2023-10-17 02:46:49 +00:00
Luke Dashjr
d9c5ef7f6a contrib/guix: Attempt to use guix shell before the deprecated guix environment 2023-10-17 01:36:57 +00:00
Luke Dashjr
bc80448c03 init: Optimise -startupnotify slightly 2023-10-17 01:36:12 +00:00
Luke Dashjr
233565f1a8 Bugfix: QA/fuzz: Add maxmempool to RPC_COMMANDS_SAFE_FOR_FUZZING 2023-10-17 01:35:08 +00:00
Luke Dashjr
8f27caeded Bugfix: QA/fuzz: Add getblocklocations to RPC_COMMANDS_SAFE_FOR_FUZZING 2023-10-17 01:34:51 +00:00
Luke Dashjr
541f7284c0 httprpc: Optimise -rpcauthfile loading slightly 2023-10-17 01:34:09 +00:00
Luke Dashjr
9582674efe Bugfix: QA/fuzz: Add listprunelocks and setprunelock to RPC_COMMANDS_SAFE_FOR_FUZZING 2023-10-17 01:33:16 +00:00
Luke Dashjr
39a0527ec7 RPC/Blockchain: Optimise setprunelock "delete all" slightly 2023-10-17 01:32:24 +00:00
Luke Dashjr
3a8a643ded Diff-minimise 2023-10-17 01:31:41 +00:00
Luke Dashjr
88a6a4021e Diff-minimise & revert ReceiveCoinsDialog context menu plural forms to singular for now 2023-10-17 01:31:41 +00:00
Luke Dashjr
c830072fbd GUI/ReceiveCoinsDialog: Allow copying labels/messages/amounts as long as at least one selected request has it populated 2023-10-17 01:31:41 +00:00
Luke Dashjr
77f5a0c4c9 GUI/RecentRequestsTableModel: Return a null string for "no amount" in edit mode 2023-10-17 01:31:41 +00:00
Luke Dashjr
8ae1cbb315 Bugfix: GUI/ReceiveCoinsDialog: Use correct Qt plural forms for context menu 2023-10-17 01:31:41 +00:00
John Moffett
b1a93c83b0 Fix Requested Payments History Multiselect
The recent payment requests list has somewhat broken functionality. You can only
select contiguous rows. Sorting the list loses the selection data. The context
menu appears when multiple rows are selected despite the actions only affecting
the first in the list. These issues are all corrected.

First, a QSortFilterProxyModel is inserted to take care of sorting instead of sorting
the model manually. This also preserves selection data when sorting. Second, the
selection model is changed to ExtendedSelection to allow for non-contiguous multi-
select. Third, the context menu now operates on multiple selections properly. It will
copy newline-separated rows of data if appropriate.

Github-Pull: gui#684
Rebased-From: a6f567590b73986fde83d8face6827e0801a2e8c
2023-10-17 01:31:36 +00:00
Luke Dashjr
2856adf4c1 Merge branch 'qt_fix_txview_202209' into qt_reqs_multiselect_pr684-25+knots 2023-10-17 01:31:16 +00:00
Luke Dashjr
1128a6bfff Refactor: GUI: Make modernize-use-default-member-init happy with columnResizingFixer 2023-10-17 01:28:47 +00:00
fanquake
7da4ae1f78
Merge bitcoin/bitcoin#28655: [25.1] Final Changes
a13670090d doc: update release notes for 25.1 (fanquake)
e8d5c35e80 doc: update manual pages for 25.1 (fanquake)
9e00b73ee7 build: bump version to 25.1 final (fanquake)

Pull request description:

  Final changes for `v25.1`.
  PR for bitcoincore.org is here: https://github.com/bitcoin-core/bitcoincore.org/pull/991.
  No additional changes have been backported since rc1 (tagged 14 days ago),
  and no bugs or issues have been reported (test bins have been available for 9 days).

ACKs for top commit:
  hebasto:
    ACK a13670090d.
  TheCharlatan:
    lgtm ACK a13670090d

Tree-SHA512: 037f937dd4d2a9de15ff15a80f35b6047b61ffc3d9a33e7d4a4fcbce6302569bbc516c6da5849211b34ebbe914c4edcdd182e2d1d43897d0dcd32834ce6f2574
2023-10-16 16:44:20 +01:00
fanquake
a13670090d
doc: update release notes for 25.1 2023-10-16 11:35:40 +02:00
fanquake
e8d5c35e80
doc: update manual pages for 25.1 2023-10-16 11:34:25 +02:00
fanquake
9e00b73ee7
build: bump version to 25.1 final 2023-10-16 11:30:08 +02:00
fanquake
167d3e2f16
Merge bitcoin/bitcoin#28559: [25.1] Final changes for 25.1rc1
10f3f813b2 doc: add release notes for 25.1rc1 (fanquake)
71aed7aa31 doc: update manual pages for 25.1rc1 (fanquake)
02f059c819 build: Bump version to 25.1rc1 (fanquake)
dc1fcec026 doc: add 25.0 release notes (fanquake)

Pull request description:

  Final changes to tag a `25.1rc1`.
  Bumps version numbers, man pages, adds release notes etc.

ACKs for top commit:
  dergoegge:
    ACK 10f3f813b2
  hebasto:
    ACK 10f3f813b2, I have reviewed the code and it looks OK.
  willcl-ark:
    ACK 10f3f813b2
  stickies-v:
    ACK 10f3f813b2

Tree-SHA512: 3e1c527dac06afb4c8e1e481055211f69aa0ed769ac242ed610d23d470bbc0c062227034d01876ba4a5fa836e953fb001e8b0d6bc026069d372d34b8a031fb25
2023-10-04 13:10:16 +01:00
fanquake
10f3f813b2
doc: add release notes for 25.1rc1 2023-10-04 11:24:05 +01:00
fanquake
71aed7aa31
doc: update manual pages for 25.1rc1 2023-10-04 11:24:05 +01:00
fanquake
02f059c819
build: Bump version to 25.1rc1 2023-10-04 11:24:05 +01:00
fanquake
dc1fcec026
doc: add 25.0 release notes 2023-10-04 11:24:05 +01:00
fanquake
9f8d501cb8
Merge bitcoin/bitcoin#28487: [25.1] Final backports
45a5fcb165 http: bugfix: track closed connection (stickies-v)
752a456fa8 http: log connection instead of request count (stickies-v)
ae86adabe4 http: refactor: use encapsulated HTTPRequestTracker (stickies-v)
f31899d19a gui: macOS, make appMenuBar part of the main app window (furszy)
64ffa94231 gui: macOS, do not process dock icon actions during shutdown (furszy)
e270f3f857 depends: fix unusable memory_resource in macos qt build (fanquake)
a6683945ca build, macos: Fix `qt` package build with new Xcode 15 linker (Hennadii Stepanov)
b3517cb1b5 test: Test loading wallets with conflicts without a chain (Andrew Chow)
d63478cb50 wallet: Check last block and conflict height are valid in MarkConflicted (Andrew Chow)
5e51a9cc72 ci: Nuke Android APK task, Use credits for tsan (MarcoFalke)
910c36253e test: ensure old fee_estimate.dat not read on restart and flushed (ismaelsadeeq)
37764d3300 tx fees, policy: read stale fee estimates with a regtest-only option (ismaelsadeeq)
16bb9161fa tx fees, policy: do not read estimates of old fee_estimates.dat (ismaelsadeeq)
c4dd5989b3 tx fees, policy: periodically flush fee estimates to fee_estimates.dat (ismaelsadeeq)
c36770cefd test: wallet, verify migration doesn't crash for an invalid script (furszy)
0d2a33e05c wallet: disallow migration of invalid or not-watched scripts (furszy)
2c51a07c08 Do not use std::vector = {} to release memory (Pieter Wuille)

Pull request description:

  Further backports for the `25.x` branch. Currently:
  * https://github.com/bitcoin/bitcoin/pull/27622
  * https://github.com/bitcoin/bitcoin/pull/27834
  * https://github.com/bitcoin/bitcoin/pull/28125
  * https://github.com/bitcoin/bitcoin/pull/28452
  * https://github.com/bitcoin/bitcoin/pull/28542
  * https://github.com/bitcoin/bitcoin/pull/28543
  * https://github.com/bitcoin/bitcoin/pull/28551
  * https://github.com/bitcoin/bitcoin/pull/28571
  * https://github.com/bitcoin-core/gui/pull/751

ACKs for top commit:
  hebasto:
    re-ACK 45a5fcb165, only #28551 has been backported with since my recent [review](https://github.com/bitcoin/bitcoin/pull/28487#pullrequestreview-1655584132).
  dergoegge:
    reACK 45a5fcb165
  willcl-ark:
    reACK 45a5fcb165

Tree-SHA512: 0f5807aa364b7c2a2039fef11d5cd5e168372c3bf5b0e941350fcd92e7db4a1662801b97bb4f68e29788c77d24bbf97385a483c4501ca72d93fa25327d5694fa
2023-10-04 11:23:14 +01:00
stickies-v
45a5fcb165
http: bugfix: track closed connection
It is possible that the client disconnects before the request is
handled. In those cases, evhttp_request_set_on_complete_cb is never
called, which means that on shutdown the server we'll keep waiting
endlessly.

By adding evhttp_connection_set_closecb, libevent automatically
cleans up those dead connections at latest when we shutdown, and
depending on the libevent version already at the moment of remote
client disconnect. In both cases, the bug is fixed.

Github-Pull: #28551
Rebased-From: 68f23f57d7
2023-10-04 10:12:59 +01:00
stickies-v
752a456fa8
http: log connection instead of request count
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
2023-10-04 10:11:01 +01:00
stickies-v
ae86adabe4
http: refactor: use encapsulated HTTPRequestTracker
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
2023-10-04 10:10:35 +01:00
pablomartin4btc
dd280990b2 gui: Update Node window title with chain type
Update Node window with the chain type except for mainnet.
This replicates the behaviour of the main window.

Github-Pull: gui#758
Rebased-From: 9d37886a3b
2023-10-03 17:42:10 +00:00
furszy
f31899d19a
gui: macOS, make appMenuBar part of the main app window
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
2023-10-03 15:59:17 +01:00
furszy
64ffa94231
gui: macOS, do not process dock icon actions during shutdown
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
2023-10-03 15:58:41 +01:00
fanquake
e270f3f857
depends: fix unusable memory_resource in macos qt build
See https://codereview.qt-project.org/c/qt/qtbase/+/482392.

Github-Pull: #28571
Rebased-From: 848eec0936
2023-10-03 15:55:04 +01:00
Hennadii Stepanov
a6683945ca
build, macos: Fix qt package build with new Xcode 15 linker
Github-Pull: #28543
Rebased-From: 79ef528511
2023-10-03 10:32:55 +01:00
Lawrence Nahum
fe66eb8a9f add support to save fee estimates without shutting down the node 2023-10-03 01:52:35 +00:00
Luke Dashjr
52e727f16d Merge branch 'fee_est_stalecheck-25+knots' into rpc_savefeeestimates-25+knots 2023-10-03 01:52:28 +00:00