Commit graph

34636 commits

Author SHA1 Message Date
fanquake
b8c146b877
build: systemtap 4.7
From 4.6, SystemTap now supports 64-bit RISC-V.

* What's new in version 4.6, 2021-11-15
- SystemTap has added support for the 64-bit RISC-V architecture.
2022-06-13 14:43:06 +01:00
MacroFake
3340d46cd3
Merge bitcoin/bitcoin#25352: test: Fix previous release binary download script for Apple ARM64
5733ae51ce test: Fix previous release binary download script for Apple ARM64 (Fabian Jahr)

Pull request description:

  The Apple M1 chip binaries at https://bitcoincore.org/bin/bitcoin-core-23.0/ are use `arm64` and not `aarch64` in the file name. This means on my M1 Macbook the v23 binary could not be downloaded: "Binary tag was not found".

  This changes the script to map the `aarch64` from the host detection to `arm64`.

ACKs for top commit:
  fanquake:
    ACK 5733ae51ce

Tree-SHA512: bd70c5361c8b549363b11be770ad285f885787ec8781f51a69c1ebbfd08f762ac6ec4d5a92c0d83ce3c8bfb7fc72750c25d42092666d00cc372e62de0f052171
2022-06-13 15:23:59 +02:00
brunoerg
216c9b00ec test: passing a value below 5 MB to -maxmempool should throw an error 2022-06-13 09:58:22 -03:00
laanwj
5174a139c9
Merge bitcoin/bitcoin#25313: guix: re-revert risc-v execstack workaround
2dcf3e153f guix: re-revert riscv execstack workaround (fanquake)

Pull request description:

  Now that we use GCC 10 for release builds, we no-longer need to
  pass `-Wl,-z,noexecstack` to get a non-executable stack in RISC-V binaries.

  This was originally removed in #21036, but then re-added in #21799, when
  we reverted to using GCC 8.

  Guix Build (arm64):
  ```bash
  0655a94f88e8e89b1e048ae96e99c7dd45aed32011fe4ed9d03d0d1dfa073650  guix-build-2dcf3e153fbc/output/arm-linux-gnueabihf/SHA256SUMS.part
  7c803347073839e2c7d8c1260e691964ab00b149da506edda4dc693df8e7f345  guix-build-2dcf3e153fbc/output/arm-linux-gnueabihf/bitcoin-2dcf3e153fbc-arm-linux-gnueabihf-debug.tar.gz
  3b9ce2f349b9a4a463f66c9a2838e8490d4990c5b8dea9ad458b0bafeba8d1ac  guix-build-2dcf3e153fbc/output/arm-linux-gnueabihf/bitcoin-2dcf3e153fbc-arm-linux-gnueabihf.tar.gz
  557c01453e3cedf6ef171715a02fe63abd7223f779a8c9b94ddc9ec17a4a45e4  guix-build-2dcf3e153fbc/output/arm64-apple-darwin/SHA256SUMS.part
  26fcdbd10ad372ef541f519cc4990bdb5d513b51b05252ce9bde6e84258157b9  guix-build-2dcf3e153fbc/output/arm64-apple-darwin/bitcoin-2dcf3e153fbc-arm64-apple-darwin-unsigned.dmg
  b145a9f6716f8e7f8c23d247fa82a02e4e7b76bebb17d55a1190448d0db5ab23  guix-build-2dcf3e153fbc/output/arm64-apple-darwin/bitcoin-2dcf3e153fbc-arm64-apple-darwin-unsigned.tar.gz
  f172cd4c799a7ab065a36829fb8d546e83ce6791d9cb326d7cef14ad74d63d7a  guix-build-2dcf3e153fbc/output/arm64-apple-darwin/bitcoin-2dcf3e153fbc-arm64-apple-darwin.tar.gz
  9a6c886a0bc81e729e3bb50dd972e10c8d4563bcbd917a9ba9c418a6fbe2de71  guix-build-2dcf3e153fbc/output/dist-archive/bitcoin-2dcf3e153fbc.tar.gz
  254a11143d61aeb98749cd405ed307cca77e80198d58b7bb669ef9490cc8eaf6  guix-build-2dcf3e153fbc/output/powerpc64-linux-gnu/SHA256SUMS.part
  83d7dc51404e328f6965f4d2da0b76fbe0a712d48465d6713348e0c4eb314a0a  guix-build-2dcf3e153fbc/output/powerpc64-linux-gnu/bitcoin-2dcf3e153fbc-powerpc64-linux-gnu-debug.tar.gz
  522b98c63ab76dac6083a17f6b8f8173e9683f7d79e6f46b0a2e56c48e841a02  guix-build-2dcf3e153fbc/output/powerpc64-linux-gnu/bitcoin-2dcf3e153fbc-powerpc64-linux-gnu.tar.gz
  96053b629ba60446f499d19400a25913932a02920bad963aaa12f1b6337b9f6e  guix-build-2dcf3e153fbc/output/powerpc64le-linux-gnu/SHA256SUMS.part
  147f0b1d07b986879a859e6d6186c339085bcfcac4c5fe30586f94e0ab09ce77  guix-build-2dcf3e153fbc/output/powerpc64le-linux-gnu/bitcoin-2dcf3e153fbc-powerpc64le-linux-gnu-debug.tar.gz
  c916680e75fb265e4099244cb876c2535c45981fbba9cfef9ad47c3aa58bc60b  guix-build-2dcf3e153fbc/output/powerpc64le-linux-gnu/bitcoin-2dcf3e153fbc-powerpc64le-linux-gnu.tar.gz
  b90329d8531afb450678ec3d0981d3b1542f7b17d2feb0f2630216d0479630ad  guix-build-2dcf3e153fbc/output/riscv64-linux-gnu/SHA256SUMS.part
  c77f02947d57ad2b841d594dca55271c9aecc1ef03f55371e0109ccaa5782aba  guix-build-2dcf3e153fbc/output/riscv64-linux-gnu/bitcoin-2dcf3e153fbc-riscv64-linux-gnu-debug.tar.gz
  234f54da9df09ef2f330be016d58ab11e81e49644db01b6093050b5fcd5c5c82  guix-build-2dcf3e153fbc/output/riscv64-linux-gnu/bitcoin-2dcf3e153fbc-riscv64-linux-gnu.tar.gz
  637f4a77d17493b319fb404e91c949373e0105caff61200f2a62729ca515f6de  guix-build-2dcf3e153fbc/output/x86_64-apple-darwin/SHA256SUMS.part
  6cbe6c91e0a35df9f92af461f68f823c7d12c37237c33e0169825ba56eb9a7c3  guix-build-2dcf3e153fbc/output/x86_64-apple-darwin/bitcoin-2dcf3e153fbc-x86_64-apple-darwin-unsigned.dmg
  b9b8cc7317e62a34f2286e07f743d4274b7ad00e93653e281257fc3bc068f30c  guix-build-2dcf3e153fbc/output/x86_64-apple-darwin/bitcoin-2dcf3e153fbc-x86_64-apple-darwin-unsigned.tar.gz
  b846df40c5a956ca02a017fbd2b97bc39caba876f7b6ad080ba1962b9092cb0d  guix-build-2dcf3e153fbc/output/x86_64-apple-darwin/bitcoin-2dcf3e153fbc-x86_64-apple-darwin.tar.gz
  5260fe7678567af5e73d296bfb115e09cc352e039fa6ae41007a6a93a5d1d6fd  guix-build-2dcf3e153fbc/output/x86_64-linux-gnu/SHA256SUMS.part
  2ddbf9afe86ff3bcde44a6beb8e1fa2a8b9a35ceae33aa1633878d8c7f611939  guix-build-2dcf3e153fbc/output/x86_64-linux-gnu/bitcoin-2dcf3e153fbc-x86_64-linux-gnu-debug.tar.gz
  a21eb3ad0671d3f09ce3b1e5263ba6cd9ea56f2c51d849bc39010b9c2b273ebf  guix-build-2dcf3e153fbc/output/x86_64-linux-gnu/bitcoin-2dcf3e153fbc-x86_64-linux-gnu.tar.gz
  0043277076a16b2baf5dc1957c2e176d5c5d95abe693b3d6bd6dec7ccb9f5481  guix-build-2dcf3e153fbc/output/x86_64-w64-mingw32/SHA256SUMS.part
  c7271c7ee7361c2f3349a00fd444fcfd42b07dbe77905a5570366312ba413fbc  guix-build-2dcf3e153fbc/output/x86_64-w64-mingw32/bitcoin-2dcf3e153fbc-win64-debug.zip
  19197d3abd2f422ad860a888578369da453509be3f8cab04cbf80055263b83c9  guix-build-2dcf3e153fbc/output/x86_64-w64-mingw32/bitcoin-2dcf3e153fbc-win64-setup-unsigned.exe
  21bfae266d684e95ebe8bcf40102c3ee8468e3d7364f6d6c5c6dd9dfc06b376a  guix-build-2dcf3e153fbc/output/x86_64-w64-mingw32/bitcoin-2dcf3e153fbc-win64-unsigned.tar.gz
  2feb16aab1fb0007670f816b1e25bff031acca01f68e3b5a8b20d13b60542b48  guix-build-2dcf3e153fbc/output/x86_64-w64-mingw32/bitcoin-2dcf3e153fbc-win64.zip
  ```

ACKs for top commit:
  laanwj:
    ACK 2dcf3e153f
  hebasto:
    ACK 2dcf3e153f

Tree-SHA512: 04dd2fcd731c6370a903bdc4bff493ed3f4b2c853be47da1a1f8838a6f6b69333464181ea945d513247a81fab1c798b3d2ad61aa8b23314890d9bd83b2f55873
2022-06-13 09:26:43 +02:00
Fabian Jahr
5733ae51ce
test: Fix previous release binary download script for Apple ARM64 2022-06-12 19:19:36 +02:00
Hennadii Stepanov
37633d2f61
Merge bitcoin-core/gui#602: Unify bitcoin-qt and bitcoind persistent settings
e47c6c7656 Reset settings.json when GUI options are reset (Ryan Ofsky)
99ccc02b65 Add release notes about unified bitcoin-qt and bitcoind persistent settings (Ryan Ofsky)
504b06b1de Migrate -lang setting from QSettings to settings.json (Ryan Ofsky)
9a016a3c07 Migrate -prune setting from QSettings to settings.json (Ryan Ofsky)
f067e19433 Migrate -proxy and -onion settings from QSettings to settings.json (Ryan Ofsky)
a09e3b7cf2 Migrate -listen and -server settings from QSettings to settings.json (Ryan Ofsky)
d2ada6e635 Migrate -upnp and -natpmp settings from QSettings to settings.json (Ryan Ofsky)
1dc4fc29c1 Migrate -spendzeroconfchange and -signer settings from QSettings to settings.json (Ryan Ofsky)
a7ef6d5975 Migrate -par setting from QSettings to settings.json (Ryan Ofsky)
284f339de6 Migrate -dbcache setting from QSettings to settings.json (Ryan Ofsky)

Pull request description:

  If a setting like pruning, port mapping, or a network proxy is enabled in the GUI, it will now be stored in the bitcoin persistent setting file in the datadir and shared with bitcoind, instead of being stored as Qt settings which end up in the the windows registry or platform specific config files and are ignored by bitcoind.

  This PR has been split off from bitcoin/bitcoin#15936 so some review of these commits previously took place in that PR.

ACKs for top commit:
  furszy:
    Code review ACK e47c6c76
  hebasto:
    ACK e47c6c7656

Tree-SHA512: 076ea7c7efe67805b4a357113bfe1643dce364d0032774106de59566a0ed5771d57a5923920085e03d686beb34b98114bd278555dfdf8bb7af0b778b0f35b7d2
2022-06-12 14:59:14 +02:00
Hennadii Stepanov
7ab72b9d2a
qt: Fix BitcoinAmountField's base widget 2022-06-12 13:40:48 +02:00
Hennadii Stepanov
3262542104
qt, refactor: Fix sendcoinsentry.ui indentation 2022-06-12 13:40:48 +02:00
Hennadii Stepanov
f3c7603329
qt, refactor: Convert SendCoinsEntry to a sub-QWidget
It is no longer needed to derive the `SendCoinsEntry` class from the
`QStackedWidget` one.
2022-06-12 13:40:46 +02:00
Hennadii Stepanov
9ef180a0ab
Merge bitcoin-core/gui#608: wallet, refactor: Make WalletModel::sendCoins() return void
1f653dc262 qt, wallet, refactor: Make `WalletModel::sendCoins()` return `void` (Hennadii Stepanov)

Pull request description:

  Currently, the `WalletModel::sendCoins()` function always returns the same value.

  Also dead and noop (calling `processSendCoinsReturn(OK)`) code has been removed.

  The other `return` statements have been removed from the `WalletModel::sendCoins()` function in bitcoin/bitcoin#17154 and bitcoin/bitcoin#17165.

ACKs for top commit:
  kristapsk:
    cr ACK 1f653dc262
  furszy:
    Code review ACK 1f653dc2
  shaavan:
    Code Review ACK 1f653dc262
  w0xlt:
    Code Review ACK 1f653dc262

Tree-SHA512: 2b59495a7fc10b4de30fcc63fc3af92d50406e16031112eb72494736dce193ac1fbac0802623496cf81edcd16766e1647d9c4f3a607b3eb84cc50e273b999c04
2022-06-12 13:33:55 +02:00
fanquake
913b1f2a5e
Update secp256k1 subtree to latest upstream master 2022-06-11 14:55:18 +01:00
fanquake
c41bfd1070 Squashed 'src/secp256k1/' changes from 8746600ee..44c2452fd
44c2452fd Merge bitcoin-core/secp256k1#1105: Don't export symbols in static libraries
6f6cab998 abi: Don't export symbols in static Windows libraries
485f608fa Merge bitcoin-core/secp256k1#1104: Fix the false positive of `SECP_64BIT_ASM_CHECK`
8b013fce5 Merge bitcoin-core/secp256k1#1056: Save negations in var-time group addition
7efc9835a Fix the false positive of `SECP_64BIT_ASM_CHECK`
2f984ffc4 Save negations in var-time group addition

git-subtree-dir: src/secp256k1
git-subtree-split: 44c2452fd387f7ca604ab42d73746e7d3a44d8a2
2022-06-11 14:55:18 +01:00
fanquake
fbae8c59a2
compat: Consolidate mingw-w64 ASLR workaround for upstream libsecp changes
Achieve this by adding a MAIN_FUNCTION macro, consolidating the docs, and
introducing the macro across our distributed binaries.

Also update the docs to explain that anyone using binutils < 2.36 is
effected by this issue. Release builds are not, because they use binutils
2.37. Currently LTS Linux distros, like Ubuntu Focal, ship with 2.34.

https://packages.ubuntu.com/focal/binutils
2022-06-11 14:55:13 +01:00
MacroFake
b71d37da2c
Merge bitcoin/bitcoin#25333: test: Fix out-of-range port collisions
fa7a711a30 test: Fix out-of-range port collisions (MacroFake)

Pull request description:

  Otherwise the test will fail if two tests running in parallel use the same port. See https://github.com/bitcoin/bitcoin/pull/25096#discussion_r892558783 and https://github.com/bitcoin/bitcoin/pull/25312

ACKs for top commit:
  dergoegge:
    ACK fa7a711a30 - This gets rid of some rather arbitrary choices for ports in some of our functional tests that can cause port collisions across test runs, resulting in intermittent failures.

Tree-SHA512: ac73da8a498230b992ab12e1ee3c4ff3d868cd63c00d2c71537d156cb7c8f8be8598ec574646b17c5a44ae3ac5bb54bf29d300f054a36cec6f6ce8054a0da0a4
2022-06-10 17:17:31 +02:00
Martin Zumsande
99b9e5f3a9 p2p: always set nTime for self-advertisements
If we self-advertised to an inbound peer with the address they gave us,
nTime was left default-initialized, so that our peer wouldn't relay it
any further along.
2022-06-10 10:50:07 -04:00
MacroFake
8f3ab9a1b1
Merge bitcoin/bitcoin#24931: Strengthen thread safety assertions
ce893c0497 doc: Update developer notes (Anthony Towns)
d2852917ee sync.h: Imply negative assertions when calling LOCK (Anthony Towns)
bba87c0553 scripted-diff: Convert global Mutexes to GlobalMutexes (Anthony Towns)
a559509a0b sync.h: Add GlobalMutex type (Anthony Towns)
be6aa72f9f qt/clientmodel: thread safety annotation for m_cached_tip_mutex (Anthony Towns)
f24bd45b37 net_processing: thread safety annotation for m_tx_relay_mutex (Anthony Towns)

Pull request description:

  This changes `LOCK(mutex)` for non-global, non-recursive mutexes to be annotated with the negative capability for the mutex it refers to, to prevent . clang applies negative capabilities recursively, so this helps avoid forgetting to annotate functions.

  This can't reasonably be used for globals, because clang would require every function to be annotated with `EXCLUSIVE_LOCKS_REQUIRED(!g_mutex)` for each global mutex; so this introduces a trivial `GlobalMutex` subclass of `Mutex`, and reduces the annotations for both `GlobalMutex`  to `LOCKS_EXCLUDED` which only catches trivial errors (eg (`LOCK(x); LOCK(x);`).

ACKs for top commit:
  MarcoFalke:
    review ACK ce893c0497 🐦
  hebasto:
    ACK ce893c0497

Tree-SHA512: 5c35e8c7677ce3d994a7e3774f4344adad496223a51b3a1d1d3b5f20684b2e1d5cff688eb3fbc8d33e1b9940dfa76e515f9434e21de6f3ce3c935e29a319f529
2022-06-10 16:42:53 +02:00
MacroFake
fa7a711a30
test: Fix out-of-range port collisions 2022-06-10 15:56:07 +02:00
Oskar Mendel
1cb42aeda3
util: modify Win32LockedPageAllocator to query windows for limit 2022-06-10 14:44:23 +02:00
fanquake
491bb14c0c
build: test for timingsafe_bcmp
Code introduced in #15649 added usage of `timingsafe_bcmp()`, if
available, otherwise falling back to our own implementation. However
the relevant build system check was never added, so currently, we'll
always just use our implementation, as HAVE_TIMINGSAFE_BCMP will never
be defined.

Add the check for timingsafe_bcmp. Note that as far as I'm aware, it's
only available on OpenBSD.
2022-06-10 12:39:08 +01:00
MacroFake
c3daa321f9
Merge bitcoin/bitcoin#25312: test: Fix port collisions caused by p2p_getaddr_caching.py
ea54ba2f42 [test] Fix port collisions caused by p2p_getaddr_caching.py (dergoegge)
f9682e75ac [test_framework] Set PortSeed.n directly after initialising params (dergoegge)

Pull request description:

  This PR fixes the issue mentioned [here](https://github.com/bitcoin/bitcoin/pull/25096#discussion_r892558783), to avoid port collisions between nodes spun up by the test framework.

Top commit has no ACKs.

Tree-SHA512: ec9159f0af90db636f7889d664c24e1430cf2bcb3c02a9ab2dcfe531b2a4d18f6e3a0f8ba73071bdf2f7db518df9d5d86a9cd06695e67644d20fe4515fac32b7
2022-06-10 12:37:27 +02:00
Vasil Dimov
6e68ccbefe
net: use Sock::WaitMany() instead of CConnman::SocketEvents()
Rename `GenerateSelectSet()` to `GenerateWaitSockets()` and adapt it to
generate a wait data suitable for `Sock::WaitMany()`. Then call it from
`CConnman::SocketHandler()` and feed the generated data to
`Sock::WaitMany()`.

This way `CConnman::SocketHandler()` can be unit tested because
`Sock::WaitMany()` is mockable, so the usage of real sockets can be
avoided.

Resolves https://github.com/bitcoin/bitcoin/issues/21744
2022-06-09 16:20:24 +02:00
fanquake
e3c08eb620
Merge bitcoin/bitcoin#25307: doc: fix typo in kernel/context.h and add desig to ignore-words
d575413fb8 doc: add `desig` to ignore-words (brunoerg)
c06cc41ddb doc: fix typo in kernel/context.h (brunoerg)

Pull request description:

  This PR fixes a typo in `kernel/context.h` (libary => library) and add `desig` to ignore-words since it's a valid word, see:
  b9416c3847/src/net.cpp (L1105-L1117)

ACKs for top commit:
  fanquake:
    ACK d575413fb8

Tree-SHA512: 2d548c737b8184d0243445c7503f3f68256ecb0970bd834d52de099de3cd8c8b9c140e2b77d55e2542fbd45b1d21cbdee639f5b2ef8138c37b8b72e5211029c3
2022-06-09 13:24:00 +01:00
Vasil Dimov
ae263460ba
net: introduce Sock::WaitMany()
It allows waiting concurrently on more than one socket. Being a
`virtual` `Sock` method it can be overriden by tests.

Will be used to replace `CConnman::SocketEvents()`.
2022-06-09 14:20:18 +02:00
brunoerg
d575413fb8 doc: add desig to ignore-words 2022-06-09 09:16:34 -03:00
Vasil Dimov
cc74459768
net: also wait for exceptional events in Sock::Wait()
This mimics closely `CConnman::SocketEvents()` and the underlying
`poll(2)`.
2022-06-09 13:34:27 +02:00
fanquake
9edc5133d4
Merge bitcoin/bitcoin#25303: refactor: Remove redundant addrman time checks
8888bd43c1 Remove redundant nLastTry check (MarcoFalke)
00001e57fe Remove redundant nTime checks (MarcoFalke)

Pull request description:

  Split out from https://github.com/bitcoin/bitcoin/pull/24697 because it makes sense on its own.

ACKs for top commit:
  dergoegge:
    re-ACK 8888bd43c1
  naumenkogs:
    utACK 8888bd43c1

Tree-SHA512: 32c6cde1c71e943c76b7991c2c24caf29ae467ab4ea2d758483a0cee64625190d1a833b468e8eab1f834beeb2c365af96552c14b05270f08cf63790e0707581d
2022-06-09 12:28:25 +01:00
dergoegge
ea54ba2f42 [test] Fix port collisions caused by p2p_getaddr_caching.py 2022-06-08 21:00:45 +02:00
dergoegge
f9682e75ac [test_framework] Set PortSeed.n directly after initialising params
This allows us to use `p2p_port()` with `set_test_params()`.
2022-06-08 21:00:18 +02:00
MacroFake
455780b1ae
Merge bitcoin/bitcoin#25294: test: Fix wait_for_debug_log UnicodeDecodeError
fa74b63c01 test: Fix wait_for_debug_log UnicodeDecodeError (MacroFake)

Pull request description:

  Fix the intermittent `UnicodeDecodeError` when the debug log is truncated on an (multi-byte) unicode character by treating everything as bytes.

  Also, remove the `ignore_case` option and the`re.search+re.escape` wrap. All of this is unused and doesn't exist on raw byte strings.

  Fixes https://github.com/bitcoin/bitcoin/issues/24575

ACKs for top commit:
  jonatack:
    ACK fa74b63c01
  brunoerg:
    ACK fa74b63c01

Tree-SHA512: c67c9355073e784fa8d9d48b8e79ff0c98f5ae9cd4d704ad12a76d2604733946054bc74b8ab346aa2184db23d740b85c8c13eb892d76cba92e42ebfd73f2f1bf
2022-06-08 17:53:06 +02:00
MacroFake
2e079c86ae
Merge bitcoin/bitcoin#24395: build: use BOOST_MULTI_INDEX_ENABLE_SAFE_MODE when debugging
06e18e0b53 build: use BOOST_MULTI_INDEX_ENABLE_SAFE_MODE when debugging (fanquake)

Pull request description:

  Use of this macro enables precondition checks for iterators and functions of the library. It's use is recommended in debug builds. See https://www.boost.org/doc/libs/1_78_0/libs/multi_index/doc/tutorial/debug.html for more info.

  There is also a `BOOST_MULTI_INDEX_ENABLE_INVARIANT_CHECKING` macro:
  > When this mode is in effect, all public functions of Boost.MultiIndex will perform post-execution tests aimed at ensuring that the basic internal invariants of the data structures managed are preserved.

ACKs for top commit:
  laanwj:
    Concept and code review ACK 06e18e0b53

Tree-SHA512: 7ee489eccda81c7dbca9210af6d3007d5b2c704b645139d2714c077af157789dd9478c29d0d212e210e96686ea83713aaf3d458e879122b3cde64f3e3e3789d2
2022-06-08 17:20:15 +02:00
furszy
fd5c996d16
wallet: GetAvailableBalance, remove double walk-through every available coin
Filtering `AvailableCoins` by spendable outputs only and using the retrieved total_amount.
2022-06-08 11:30:26 -03:00
furszy
162d4ad10f
wallet: add 'only_spendable' filter to AvailableCoins
We are skipping the non-spendable coins that appear in vCoins ('AvailableCoins' result) later, in several parts of the CreateTransaction and GetBalance flows:

GetAvailableBalance (1) gets all the available coins calling AvailableCoins and, right away, walk through the entire vector, skipping the non-spendable coins, to calculate the total balance.

Inside CreateTransactionInternal —> SelectCoins(vCoins,...), we have several calls to AttemptSelection which, on each of them internally, we call twice to GroupOutputs which internally has two for-loops over the entire vCoins vector that skip the non-spendable coins.

So, Purpose is not add the non-spendable coins into the AvailableCoins result (vCoins) in the first place for the processes that aren’t using them at all, so we don’t waste resources skipping them later so many times.

Note: this speedup is for all the processes that call to CreateTransaction and GetBalance* internally.
2022-06-08 11:30:25 -03:00
furszy
cdf185ccfb
wallet: remove unused IsSpentKey(hash, index) method 2022-06-08 11:22:40 -03:00
furszy
4b83bf8dbc
wallet: avoid extra IsSpentKey -> GetWalletTx lookups 2022-06-08 11:22:40 -03:00
furszy
3d8a282257
wallet: decouple IsSpentKey(scriptPubKey) from IsSpentKey(hash, n)
This will be used in a follow-up commit to prevent extra 'GetWalletTx' lookups if the function caller already have the wtx and can just provide the scriptPubKey directly.
2022-06-08 11:22:39 -03:00
furszy
a06fa94ff8
wallet: IsSpent, 'COutPoint' arg instead of (hash, index) 2022-06-08 11:22:39 -03:00
furszy
91902b7720
wallet: IsLockedCoin, 'COutPoint' arg instead of (hash, index) 2022-06-08 10:26:48 -03:00
furszy
9472ca0a65
wallet: AvailableCoins, don't call 'wtx.tx->vout[i]' multiple times 2022-06-08 10:25:51 -03:00
furszy
4ce235ef8f
wallet: return 'CoinsResult' struct in AvailableCoins
Instead of accepting a `vCoins` reference that is cleared at the beginning of the method.

Note:
This new struct, down the commits line, will contain other `AvailableCoins` useful results.
2022-06-08 10:25:16 -03:00
brunoerg
c06cc41ddb doc: fix typo in kernel/context.h 2022-06-08 10:03:43 -03:00
Jon Atack
ecff20db28 logging: use LogPrintfCategory rather than a manual category
Here we update only the log messages that manually print a category.

In upcoming commits, LogPrintCategory will likely be used in many
other cases, such as to replace `LogPrintf` where it makes sense.
2022-06-08 14:02:54 +02:00
Jon Atack
eb8aab759f logging: add LogPrintfCategory to log unconditionally with category
prefixing the output with the passed category name.

- add documentation
- add a unit test
- update lint-logs.py
- update lint-format-strings.py
2022-06-08 14:02:54 +02:00
MarcoFalke
8888bd43c1
Remove redundant nLastTry check
All other places calculate "now - nLastTry", which is safe and correct
to do when nLastTry is 0. So do the same here.
2022-06-08 13:35:32 +02:00
fanquake
b9416c3847
Merge bitcoin/bitcoin#25096: [net] Minor improvements to addr caching
292828cd77 [test] Test addr cache for multiple onion binds (dergoegge)
3382905bef [net] Seed addr cache randomizer with port from binding address (dergoegge)
f10e80b6e4 [net] Use ConnectedThroughNetwork() instead of GetNetwork() to seed addr cache randomizer (dergoegge)

Pull request description:

  The addr cache id randomizer is currently supposed to be seeded with the network of the inbound connection and the local socket (only the address is used not the port):  a8098f2cef/src/net.cpp (L2800-L2804)

  For inbound onion connections `CNode::addr.GetNetwork()` returns `NET_UNROUTABLE` and `CNode::addrBind` is set to `127.0.0.1:<onion bind port>`. This results in the same addr cache for all inbound connections on 127.0.0.1 binds.

  To avoid the same addr cache across all onion and other 127.0.0.1 binds, we should seed the addr cache randomizer with the correct network for inbound onion connections (using `CNode::ConnectedThroughNetwork()`) as well as the port of `CNode::addrBind`.

ACKs for top commit:
  sipa:
    utACK 292828cd77
  mzumsande:
    Code Review ACK 292828cd77
  naumenkogs:
    utACK 292828cd77

Tree-SHA512: d0be13bab6bc121c2926d4b168687f6c2ed4ce0c9dd19be71eb4886adeba8afc3daacdc4e232a0ba3b03a89d69b618abc5595b69abd1ad0c476d825bc6ea1f9f
2022-06-08 11:21:38 +01:00
fanquake
2dcf3e153f
guix: re-revert riscv execstack workaround
Now that we use GCC 10 for release builds, we no-longer need to
pass-Wl,-z,noexecstack to get a non-executable stack in RISC-V binaries.

This was originally removed in #21036, but then re-added in #21799, when
we reverted to using GCC 8.
2022-06-08 10:43:25 +01:00
MarcoFalke
00001e57fe
Remove redundant nTime checks
nTime is always initialized on deserialization or default-initialized
with TIME_INIT, so special casing 0 does not make sense.
2022-06-08 09:17:39 +02:00
MacroFake
bbf2a25044
Merge bitcoin/bitcoin#25298: doc: Fix command in "OpenBSD Build Guide"
b1f662b859 doc: Fix command in "OpenBSD Build Guide" (Hennadii Stepanov)

Pull request description:

  Fixed `pkg_add sqlite3` command.

ACKs for top commit:
  theStack:
    ACK b1f662b859

Tree-SHA512: b1dd1baa238f76dadfb188b46bc72f993cc88ea4651cf0836cd85348429baa15228e9cd4c15e588675c9f340692118952302a8629f45d7dc275cc086917c11ca
2022-06-08 07:52:00 +02:00
Hennadii Stepanov
b1f662b859
doc: Fix command in "OpenBSD Build Guide" 2022-06-07 23:04:20 +02:00
Ben Woosley
241c4d047e
doc: Correct comment describing value of MAX_FILE_SIZE_PSBT as in MiB
100 MiB is 100 * (10224 ** 2), or 107,374,182,400 bytes.
2022-06-07 15:49:07 -05:00
darosior
64f81a38b9
doc: Correct nPruneTarget misidentifying units of variable 2022-06-07 15:30:16 -05:00