Commit graph

20033 commits

Author SHA1 Message Date
Hennadii Stepanov
8ff3743f5e
Revert "doc: Remove outdated comments"
This reverts commit ee7891a0c4, and moves
the comments into the right place.
2021-09-29 11:35:06 +03:00
Samuel Dobson
6c006495ef Remove outdated dummy wallet -salvagewallet arg 2021-09-29 15:45:20 +13:00
Amiti Uttarwar
021f86953e [style] Run changed files through clang formatter. 2021-09-28 22:21:10 -04:00
Amiti Uttarwar
375750387e scripted-diff: Rename CAddrInfo to AddrInfo
-BEGIN VERIFY SCRIPT-
git grep -l CAddrInfo src/ | xargs sed -i 's/CAddrInfo/AddrInfo/g'
-END VERIFY SCRIPT-
2021-09-28 22:21:10 -04:00
Amiti Uttarwar
dd8f7f2500 scripted-diff: Rename CAddrMan to AddrMan
-BEGIN VERIFY SCRIPT-
git grep -l CAddrMan src/ test/ | xargs sed -i 's/CAddrMan/AddrMan/g'
-END VERIFY SCRIPT-
2021-09-28 22:21:10 -04:00
Amiti Uttarwar
3c263d3f63 [includes] Fix up included files 2021-09-28 22:21:06 -04:00
fanquake
a11da75411
bloom: cleanup includes 2021-09-29 09:48:36 +08:00
fanquake
f1ed1d3194
bloom: use constexpr where appropriate 2021-09-29 09:43:37 +08:00
William Casarin
2ba4ddf31d
bloom: use Span instead of std::vector for insert and contains
We can avoid many unnecessary std::vector allocations by changing
CBloomFilter to take Spans instead of std::vector's for the `insert`
and `contains` operations.

CBloomFilter currently converts types such as CDataStream and uint256
to std::vector on `insert` and `contains`. This is unnecessary because
CDataStreams and uint256 are already std::vectors internally. We just
need a way to point to the right data within those types. Span gives
us this ability.

Signed-off-by: William Casarin <jb55@jb55.com>
2021-09-29 09:40:10 +08:00
fanquake
3c776fdcec
Merge bitcoin/bitcoin#23122: doc: Remove un-actionable TODO from chainparams.cpp
fa189621cc doc: Remove un-actionable TODO from chainparams.cpp (MarcoFalke)

Pull request description:

  This can't be fixed by writing code, see discussion in https://github.com/bitcoin/bitcoin/pull/23021/files#r717426632

ACKs for top commit:
  jarolrod:
    ACK fa189621cc
  prayank23:
    ACK fa189621cc

Tree-SHA512: 3c5c0a0f45d057c9a617797007220837d7dcb29ae5996441e41b3698a67dc3d898f465adc0a958ecef430068cd9c564540bb534bbb3b230a53130ea001629f3e
2021-09-29 09:20:56 +08:00
Amiti Uttarwar
29727c2aa1 [doc] Update comments
Maintain comments on the external interfaces rather than on the internal
functions that implement them.
2021-09-28 19:02:34 -04:00
Amiti Uttarwar
14f9e000d0 [refactor] Update GetAddr_() function signature
Update so the internal function signature matches the external one, as is the
case for the other addrman functions.
2021-09-28 19:02:34 -04:00
Amiti Uttarwar
40acd6fc9a [move-only] Move constants to test-only header
Review hint: git diff --color-moved=dimmed-zebra
--color-moved-ws=ignore-all-space
2021-09-28 19:02:34 -04:00
Amiti Uttarwar
7cf41bbb38 [addrman] Change CAddrInfo access
Since knowledge of CAddrInfo is limited to callsites that import
addrman_impl.h, only objects in addrman.cpp or the tests have access. Thus we
can remove calling them friends and make the members public.
2021-09-28 19:02:34 -04:00
Amiti Uttarwar
e3f1ea659c [move-only] Move CAddrInfo to test-only header file
Now that no bitcoind callers require knowledge of the CAddrInfo object, it can
be moved into the test-only header file.

Review hint: use git diff --color-moved=dimmed-zebra
--color-moved-ws=ignore-all-space
2021-09-28 19:02:34 -04:00
Amiti Uttarwar
7cba9d5618 [net, addrman] Remove external dependencies on CAddrInfo objects
CAddrInfo objects are an implementation detail of how AddrMan manages and adds
metadata to different records. Encapsulate this logic by updating Select &
SelectTriedCollision to return the additional info that the callers need.
2021-09-28 19:02:34 -04:00
Amiti Uttarwar
8af5b54f97 [addrman] Introduce CAddrMan::Impl to encapsulate addrman implementation.
Introduce the pimpl pattern for CAddrMan to separate the implementation details
from the externally used object representation. This reduces compile-time
dependencies and conceptually clarifies AddrMan's interface from the
implementation specifics.

Since the unit & fuzz tests currently rely on accessing CAddrMan internals, this
commit introduces addrman_impl.h, which is exclusively imported by addrman.cpp
and test files.

Review hint: git diff --color-moved=dimmed-zebra
--color-moved-ws=ignore-all-space
2021-09-28 19:02:34 -04:00
Amiti Uttarwar
f2e5f38f09 [move-only] Match ordering of CAddrMan declarations and definitions
Also move `Check` and `ForceCheckAddrman` to be after the `FunctionName_` functions.

Review hint: use git diff --color-moved=dimmed-zebra
--color-moved-ws=ignore-all-space
2021-09-28 18:56:36 -04:00
Samuel Dobson
6a5381a06b
Merge bitcoin/bitcoin#20591: wallet, bugfix: fix ComputeTimeSmart function during rescanning process.
240ea294d5 doc: update doxygen documention of ComputeTimeSmart() and AddToWalletIfInvolvingMe() regarding rescanning_old_block parameter (BitcoinTsunami)
d6eb39af21 test: add functional test to check transaction time determination during block rescanning (BitcoinTsunami)
07b44f16e7 wallet: fix ComputeTimeSmart algorithm to use blocktime during old block rescanning (BitcoinTsunami)

Pull request description:

  The function ComputeTimeSmart in wallet.cpp assume that transaction are discovered in the right order.
  Moreover the 'smarttime' determination algorithm is coded with realtime scenario in mind and not rescanning of old block.

  The functional test demonstrate that if the user import a wallet, then rescan only recent history, and then rescan the entire history, the older transaction discovered would have an incorrect time determination.
  In the context of rescanning old block, the only time value that as a meaning is the blocktime.

  That's why I've fixed the problem with a simple separation between rescanning of old block and realtime time determination. The fix is written to have no impact on every realtime scenario and only impact the behaviour during a rescanning process.
  This PR Fixes #20181.

  To be fair, I don't think that this bug could be triggered with the wallet GUI, because it always proceed with a proper rescan.
  But RPC API provide the possibility to trigger it. I've discovered it, because Specter desktop v0.10.0 was impacted. (https://github.com/cryptoadvance/specter-desktop/issues/680).

ACKs for top commit:
  jonatack:
    ACK 240ea294d5 per `git diff b92d552 240ea29`, re-verified rebase to latest master + debug build clean + new test passes on the branch and fails on master, only change since my review a few hours ago is incorporation of latest review suggestions
  meshcollider:
    re-utACK 240ea294d5

Tree-SHA512: 514b02e41d011ddfa325f5e8080b93800e1ea4ed5853fa420670a6ac700e8b463000dbea65f8ced8565cfb950c7f51b69154034dcb111e67aca3b964a0061494
2021-09-29 11:18:23 +13:00
Samuel Dobson
10c6929d55 Include vout when copying transaction ID from coin selection 2021-09-29 11:16:59 +13:00
Samuel Dobson
b55232a337
Merge bitcoin/bitcoin#22722: rpc: update estimatesmartfee to return max of CBlockPolicyEstimator::estimateSmartFee, mempoolMinFee and minRelayTxFee
ea31caf6b4 update estimatesmartfee rpc to return max of estimateSmartFee, mempoolMinFee and minRelayTxFee. (pranabp-bit)

Pull request description:

  This PR is in response to the issue [#19699](https://github.com/bitcoin/bitcoin/issues/19699).

  Based on the discussion in the comments of PR [#22673](https://github.com/bitcoin/bitcoin/pull/22673) changes have been made in the `estimatesmartfee` itself such that it takes into account `mempoolMinFee` and `relayMinFee` . Hence it provides a fee estimate that is most likely to be paid by the user in an actual transaction, preventing issues such as [#16072](https://github.com/bitcoin/bitcoin/issues/16072).

  The test file test/functional/feature_fee_estimation.py has also been updated to check this functionality.

ACKs for top commit:
  meshcollider:
    re-utACK ea31caf6b4

Tree-SHA512: 8f36153a07cbd552c5c13d11d9c6e987a7a555ea4cc83f2573c0c92dd97c706d90c30a7248671437c2f3a836d3272f8fad53d15a5fa6efaa0409ae8009b0a18d
2021-09-29 10:55:29 +13:00
Samuel Dobson
d6492d4ed0
Merge bitcoin/bitcoin#22650: Remove -deprecatedrpc=addresses flag and corresponding code/logic
43cd6b8af9 doc: add release notes for removal of the -deprecatedrpc=addresses flag (Michael Dietz)
2b1fdc2c6c refactor: minor styling, prefer snake case and same line if (Michael Dietz)
d64deac7b8 refactor: share logic between ScriptPubKeyToUniv and ScriptToUniv (Michael Dietz)
8721638daa rpc: remove deprecated addresses and reqSigs from rpc outputs (Michael Dietz)

Pull request description:

  Resolves #21797 now that we've branched-off to v23 ("addresses" and "reqSigs" deprecated) "ExtractDestinations" should be removed.

   `-deprecatedrpc=addresses` was initially added in this PR #20286 (which resolved the original issue #20102).

  Some chunks of code and logic are no longer used/necessary with the removal of this, and therefore some minor refactoring is done in this PR as well (separated commits)

ACKs for top commit:
  MarcoFalke:
    re-ACK 43cd6b8af9 🐉
  meshcollider:
    Code review ACK 43cd6b8af9
  jonatack:
    ACK 43cd6b8af9 per `git range-diff a9d0cec 92dc5e9 43cd6b8`, also rebased to latest master, debug built + quick re-review of each commit to bring back context, and ran tests locally at the final commit

Tree-SHA512: fba83495e396d3c06f0dcf49292f14f4aa6b68fa758f0503941fade1a6e7271cda8378e2734af1faea550d1b43c85a36c52ebcc9dec0732936f9233b4b97901c
2021-09-29 10:41:30 +13:00
Hennadii Stepanov
f000cdcf0a
Merge bitcoin-core/gui#434: Keep InitExecutor in main gui thread
03a5fe06bd qt: Keep InitExecutor in main gui thread (João Barbosa)

Pull request description:

  The `InitExecutor` constructor moves the instance to a dedicated thread. This PR changes that by using `GUIUtil::ObjectInvoke` to run the relevant code in that thread.

  A possible follow-up is to ditch the dedicated thread and use `QThreadPool` or even `QtConcurrent::run` (if we want to enable that).

ACKs for top commit:
  hebasto:
    ACK 03a5fe06bd, tested on Linux Mint 20.2 (Qt 5.12.8).
  jarolrod:
    ACK 03a5fe06bd

Tree-SHA512: 8b40300371d4c04efb9913600a06ba4899af0b5f50fdb26ea23ec751df6d3bd52f8bd693a5e8f6a94ebf3790583dc96c6070e6878d247dece62347aa9bd99031
2021-09-28 23:26:29 +03:00
Niklas Gögge
0dc8bf5b92 [net processing] Dont request compact blocks in blocks-only mode 2021-09-28 22:11:30 +02:00
BitcoinTsunami
240ea294d5 doc: update doxygen documention of ComputeTimeSmart() and AddToWalletIfInvolvingMe() regarding rescanning_old_block parameter 2021-09-28 21:49:35 +02:00
BitcoinTsunami
07b44f16e7 wallet: fix ComputeTimeSmart algorithm to use blocktime during old block rescanning 2021-09-28 20:56:52 +02:00
Amiti Uttarwar
5faa7dd6d8 [move-only] Move CAddrMan function definitions to cpp
In preparation for introducing the pimpl pattern to addrman, move all function
bodies out of the header file.

Review hint: use git diff --color-moved=dimmed-zebra
--color-moved-ws=ignore-all-space
2021-09-28 14:46:02 -04:00
MarcoFalke
fa189621cc
doc: Remove un-actionable TODO from chainparams.cpp 2021-09-28 20:18:20 +02:00
pranabp-bit
ea31caf6b4 update estimatesmartfee rpc to return max of estimateSmartFee, mempoolMinFee and minRelayTxFee.
This will provide better estimates which would be closer to fee paid in actual
transactions.
The test has also been changed such that when the node is restarted with a
high mempoolMinFee, the estimatesmartfee still returns a feeRate greater
than or equal to the mempoolMinFee, minRelayTxFee.(just like the feeRate of actual transactions)
2021-09-28 18:36:38 +05:30
MarcoFalke
a9d0cec499
Merge bitcoin/bitcoin#23106: Ensure wallet is unlocked before signing PSBT with walletprocesspsbt and GUI
7e3ee4cdd0 GUI: Ask user to unlock wallet before signing psbt (Samuel Dobson)
0f3acecf33 Add test that walletprocesspsbt requires unlocked wallet when signing (Samuel Dobson)
0e895212bb Ensure wallet is unlocked before signing in walletprocesspsbt (Samuel Dobson)

Pull request description:

  If signing a PSBT, we need to ensure the wallet is unlocked.

  Fixes #22874, fixes bitcoin-core/gui#312

ACKs for top commit:
  achow101:
    ACK 7e3ee4cdd0
  lsilva01:
    Code Review ACK 7e3ee4cdd0
  benthecarman:
    ACK 7e3ee4cdd0

Tree-SHA512: 6726a873582747900ab454ea21153a92be86808a4c1517dc2856b389876a2da9e8df1ffa9b567b6bd017038342c3544ecf5ca3c97744e7debe0a5ee65563687d
2021-09-28 09:49:44 +02:00
Samuel Dobson
a8bbd4cc81
Merge bitcoin/bitcoin#22938: test: Add remaining scenarios of 0 waste, in wallet waste_test
efcaefc7b5 test: Add remaining scenarios of 0 waste (rajarshimaitra)

Pull request description:

  As per the [review club](https://bitcoincore.reviews/22009) discussion on #22009 , it was observed that there were other two fee scenarios in which selection waste could be zero.

  These are:
   - (LTF - Fee) == Change Cost
   - (LTF - Fee) == Excess

  Even though these are obvious by the definition of waste metric, adding tests for them can be helpful in explaining its behavior
  to new readers of the code base, along with pinning the behavior for future.

  This PR adds those two cases to waste calculation unit test.

  Also let me know if I am missing more scenarios.

ACKs for top commit:
  jonatack:
    Tested re-ACK efcaefc7b5
  achow101:
    ACK efcaefc7b5
  meshcollider:
    ACK efcaefc7b5

Tree-SHA512: 13fe3e2c0ea7bb58d34e16c32908b84705130dec16382ff941e5e60ca5b379f9c5811b33f36c4c72d7a98cfbb6af2f196d0a69e96989afa4b9e49893eaadd7cb
2021-09-28 20:20:06 +13:00
MarcoFalke
27836f296d
Merge bitcoin/bitcoin#22942: fuzz: Cleanup muhash fuzz target
0000dca6f0 fuzz: Cleanup muhash fuzz target (MarcoFalke)

Pull request description:

ACKs for top commit:
  fjahr:
    ACK 0000dca6f0

Tree-SHA512: 9893ad5cea0faf94a18a778ae9d62d4a37850b445b6f22fdbe57c882c956c8bca6d03dd040aa4512ce3fba350b186c3d5ed80295b6310bea60197783b50b01b6
2021-09-28 08:38:09 +02:00
Samuel Dobson
7e3ee4cdd0 GUI: Ask user to unlock wallet before signing psbt 2021-09-28 13:27:07 +13:00
Sebastian Falbesoner
90be29c5b5 wallet: enable SQLite extended result codes
With this change, we get more fine-grained error messages if something
goes wrong in the course of communicating with the SQLite database. To
pick some random examples, the error codes SQLITE_IOERR_NOMEM,
SQLITE_IOERR_CORRUPTFS or SQLITE_IOERR_FSYNC are way more specific than just a
plain SQLITE_IOERR, and the corresponding error messages generated by
sqlite3_errstr() will hence give a better hint to the user (or also to the
developers, if an error report is sent) what the cause for a failure is.
2021-09-28 00:40:13 +02:00
merge-script
825f4a64e6
Merge bitcoin/bitcoin#22976: scripted-diff: Rename overloaded int GetArg to GetIntArg
93b9800fec scripted-diff: Rename overloaded int GetArg to GetIntArg (Russell Yanofsky)

Pull request description:

  This is meant to improve readability of code and remove guesswork needed to determine argument types and migrate to [typed arguments (#22978)](https://github.com/bitcoin/bitcoin/issues/22978) by having distinctly named `GetArg` `GetArgs` `GetBoolArg` and `GetIntArg` methods.

  ---

  This commit was originally part of #22766 and had some review discussion there. But it was [wisely suggested](https://github.com/bitcoin/bitcoin/pull/22766#issuecomment-910001542) to be split off  to make that PR smaller.

ACKs for top commit:
  hebasto:
    ACK 93b9800fec.
  MarcoFalke:
    re-ACK 93b9800fec 📨

Tree-SHA512: e034bd938b2c8fbadd90bcd52213a61161965dfddf18c2cb0d68816ecf2438cde8afee6fb7e3418f5c6b35c208338da9deb99e4e418dbf68ca34552e0916a625
2021-09-27 15:13:09 +02:00
W. J. van der Laan
68bbfcc250
Merge bitcoin/bitcoin#23021: net: switch to signet DNS seed
dc10ca346b net: switch to signet DNS seed (Sjors Provoost)

Pull request description:

  I spun up a DNS seed for Signet, source: https://github.com/sipa/bitcoin-seeder/pull/94

  If anyone else spins up a DNS seed, let me know in the comment and I'll add it.

  Because one DNS seed is not very diverse, this PR leaves two hardcoded nodes just in case (). The one dropped node no longer exists.

  Replaces #23000.

ACKs for top commit:
  kallewoof:
    utACK dc10ca346b
  laanwj:
    Concept and code review ACK dc10ca346b
  jarolrod:
    ACK dc10ca346b
  shaavan:
    ACK dc10ca346b

Tree-SHA512: 534d189becd51974042fddc3efe3df230484f05cd945e756eaf6a4a8a580e2161b3a959eb3d44dea526269eea6f87a033f7cbfe86586782c6ca4ee7c7c4097a9
2021-09-27 14:48:33 +02:00
W. J. van der Laan
16a5997336
Merge bitcoin/bitcoin#22579: doc: Add references for the generator/constant used in Bech32(m)
b8cd2a4292 Add references for the generator/constant used in Bech32(m) (Pieter Wuille)

Pull request description:

  I often find myself recreating this, or looking up references for this construction. So instead, this seems like as good a place as any to place a summary.

ACKs for top commit:
  Zero-1729:
    crACK b8cd2a4292

Tree-SHA512: 9d2001c5016485cea441c28fda093d67a7d4274e4c1e4dd3d357353ce6a52987e38d684d8462bad2d72ba0b6b1db2f809948e228fb02371e64b12146aace89bd
2021-09-27 14:34:04 +02:00
Samuel Dobson
0e895212bb Ensure wallet is unlocked before signing in walletprocesspsbt 2021-09-28 01:25:42 +13:00
W. J. van der Laan
07e743edd0
Merge bitcoin/bitcoin#22892: doc: Clarify that change_cost cannot be negative in GetSelectionWaste
d2eccacd18 doc: Clarify that change_cost cannot be negative in GetSelectionWaste (benthecarman)

Pull request description:

  We assert that the `change_cost` must be positive so we should document it in the function's docs

  4f5ad43b1e/src/wallet/coinselection.cpp (L361)

ACKs for top commit:
  jonatack:
    ACK d2eccacd18
  jarolrod:
    ACK d2eccacd18
  shaavan:
    ACK d2eccacd18

Tree-SHA512: 089bc41d7e212b811455527ce2ac83301eae0edc03933dcbd5229b22078827395c8e3bcfda0ba029b7c60705db3119b4f80e372842a6bd8dae195dbaa0b52833
2021-09-27 14:24:06 +02:00
João Barbosa
03a5fe06bd qt: Keep InitExecutor in main gui thread 2021-09-27 13:05:40 +01:00
MarcoFalke
faffaa85cd
log: Avoid broken SELECTCOINS log
Before this patch, the log might be corrupted by other threads logging
at the same time. For example, another RPC thread:

[httpworker.1] [default wallet] keypool reserve 1296
[httpworker.1] SelectCoins() best subset: Received a POST request for / from 127.0.0.1:53732
[httpworker.3] ThreadRPCServer method=getnetworkinfo user=__cookie__
[httpworker.1] 0.78125 0.1953125 0.02441406 0.00610351 0.00305175 0.00152587 total 1.01025417
2021-09-27 13:09:11 +02:00
Russell Yanofsky
93b9800fec scripted-diff: Rename overloaded int GetArg to GetIntArg
Improve readability of code, simplify future scripted diff cleanup PRs, and be
more consistent with naming for GetBoolArg.

This will also be useful for replacing runtime settings type checking
with compile time checking.

-BEGIN VERIFY SCRIPT-
git grep -l GetArg | xargs sed -i 's/GetArg(\([^)]*\( [0-9]\+\|-1\|port\|BaseParams().RPCPort()\|Params().GetDefaultPort()\|_TIMEOUT\|Height\|_WORKQUEUE\|_THREADS\|_CONNECTIONS\|LIMIT\|SigOp\|Bytes\|_VERSION\|_AGE\|_CHECKS\|Checks() ? 1 : 0\|_BANTIME\|Cache\|BLOCKS\|LEVEL\|Weight\|Version\|BUFFER\|TARGET\|WEIGHT\|TXN\|TRANSACTIONS\|ADJUSTMENT\|i64\|Size\|nDefault\|_EXPIRY\|HEIGHT\|SIZE\|SNDHWM\|_TIME_MS\)\))/GetIntArg(\1)/g'
-END VERIFY SCRIPT-

Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
2021-09-27 06:57:20 -04:00
W. J. van der Laan
8b523f2e55
Merge bitcoin/bitcoin#23094: doc: Remove outdated comments
ee7891a0c4 doc: Remove outdated comments (Hennadii Stepanov)

Pull request description:

  The first removed comment was introduced in #5288, the second one in #13503.

  Both are outdated since #14336.

ACKs for top commit:
  duncandean:
    crACK ee7891a0

Tree-SHA512: a2d6071919e81c916bfc2178109bbc464417321bcc567ed0644448c5faea8e58cb08a7657afa1b6ffe1fb63e114a2a47b31c893e471839ba9d49a3986e68b2a7
2021-09-27 12:57:20 +02:00
merge-script
632be5514c
Merge bitcoin/bitcoin#23061: Fix (inverse) meaning of -persistmempool
faa9c19a4b doc: Add 23061 release notes (MarcoFalke)
faff17bbde Fix (inverse) meaning of -persistmempool (MarcoFalke)

Pull request description:

  Passing `-persistmempool` is currently treated as `-nopersistmempool`

ACKs for top commit:
  jnewbery:
    reACK faa9c19a4b
  hebasto:
    ACK faa9c19a4b, I have reviewed the code and it looks OK, I agree it can be merged.

Tree-SHA512: f34a89a07745dabe340eb845b2a348b79c093e9056f7a21c17e1ba2e278177c9b4cf30e8095791fd645a7f90eb34850b2eee0c869b4f6ec02bf749c73b0e52ee
2021-09-27 10:12:14 +02:00
Jarol Rodriguez
2ccde2f932 qt: hyphenate usage of third-party modifier
Our usage of "third-party" should be hyphenated
as it is being used as a modifier of both "URL"
and "transaction URLs".
2021-09-27 01:43:09 -04:00
W. J. van der Laan
09cb5ec6c8
Merge bitcoin/bitcoin#23065: Allow UTXO locks to be written to wallet DB
d96b000e94 Make GUI UTXO lock/unlock persistent (Samuel Dobson)
077154fe69 Add release note for lockunspent change (Samuel Dobson)
719ae927dc Update lockunspent tests for lock persistence (Samuel Dobson)
f13fc16295 Allow lockunspent to store the lock in the wallet DB (Samuel Dobson)
c52789365e Allow locked UTXOs to be store in the wallet database (Samuel Dobson)

Pull request description:

  Addresses and closes #22368

  As per that issue (and its predecessor #14907), there seems to be some interest in allowing unspent outputs to be locked persistently. This PR does so by adding a flag to lockunspent to store the change in the wallet database. Defaults to false, so there is no change in default behaviour.

  Edit: GUI commit changes default behaviour. UTXOs locked/unlocked via the GUI are now persistent.

ACKs for top commit:
  achow101:
    ACK d96b000e94
  kristapsk:
    ACK d96b000e94
  lsilva01:
    Tested ACK d96b000e94 on Ubuntu 20.04
  prayank23:
    ACK d96b000e94

Tree-SHA512: 957a5bbfe7f763036796906ccb1598feb6c14c5975838be1ba24a198840bf59e83233165cb112cebae909b6b25bf27275a4d7fa425923ef6c788ff671d7a89a8
2021-09-26 11:30:18 +02:00
Samuel Dobson
d96b000e94 Make GUI UTXO lock/unlock persistent 2021-09-25 23:50:06 +12:00
Samuel Dobson
f13fc16295 Allow lockunspent to store the lock in the wallet DB 2021-09-25 23:50:06 +12:00
Samuel Dobson
c52789365e Allow locked UTXOs to be store in the wallet database 2021-09-25 23:50:06 +12:00
Hennadii Stepanov
ee7891a0c4
doc: Remove outdated comments
They are outdated since #14336.
2021-09-25 14:19:24 +03:00
Michael Dietz
2b1fdc2c6c
refactor: minor styling, prefer snake case and same line if 2021-09-24 14:22:53 -05:00
Michael Dietz
d64deac7b8
refactor: share logic between ScriptPubKeyToUniv and ScriptToUniv 2021-09-24 14:22:53 -05:00
Michael Dietz
8721638daa
rpc: remove deprecated addresses and reqSigs from rpc outputs 2021-09-24 14:22:49 -05:00
W. J. van der Laan
03cb2b480b
Merge bitcoin/bitcoin#23025: bench: update nanobench add -min_time
e148a52332 bench: fixed ubsan implicit conversion (Martin Ankerl)
da4e2f1da0 bench: various args improvements (Jon Atack)
d312fd94a1 bench: clean up includes (Jon Atack)
1f10f1663e bench: add usage description and documentation (Martin Ankerl)
d3c6f8bfa1 bench: introduce -min_time argument (Martin Ankerl)
9fef832932 bench: make EvictionProtection.* work with any number of iterations (Martin Ankerl)
153e6860e8 bench: change AddrManGood to AddrManAddThenGood (Martin Ankerl)
468b232f71 bench: remove unnecessary & incorrect  multiplication in MuHashDiv (Martin Ankerl)
eed99cf272 bench: update nanobench from 4.3.4 to 4.3.6 (Martin Ankerl)

Pull request description:

  This PR updates the nanobench with the latest release from upstream, v4.3.6. It fixes the missing performance counters.

  Due to discussions on #22999 I have done some work that should make the benchmark results more reliable. It introduces a new flag `-min_time` that allows to run a benchmark for much longer then the default. When results are unreliable, choosing a large timeframe here should usually get repeatable results even when frequency scaling cannot be disabled. The default is now 10ms. For this to work I have changed the `AddrManGood` and `EvictionProtection` benchmarks so they work with any number of iterations.

  Also, this adds more usage documentation to `bench_bitcoin -h` and I've cherry-picked two changes from #22999 authored by Jon Atack

ACKs for top commit:
  jonatack:
    re-ACK e148a52332
  laanwj:
    Code review ACK e148a52332

Tree-SHA512: 2da6de19a5c85ac234b190025e195c727546166dbb75e3f9267e667a73677ba1e29b7765877418a42b1407b65df901e0130763936525e6f1450f18f08837c40c
2021-09-24 18:39:04 +02:00
merge-script
8e9801bfc4
Merge bitcoin/bitcoin#22818: test: Activate all regtest softforks at height 1, unless overridden
fa4db8671b test: Activate all regtest softforks at height 1, unless overridden (MarcoFalke)
faad1e5ffd Introduce -testactivationheight=name@height setting (MarcoFalke)
fadb2ef2fa test: Add extra_args argument to TestChain100Setup constructor (MarcoFalke)
faa46986aa test: Remove version argument from build_next_block in p2p_segwit test (MarcoFalke)
fa086ef539 test: Remove unused ~TestChain100Setup (MarcoFalke)

Pull request description:

  All softforks that are active at the tip of mainnet, should also be active from genesis in regtest. Otherwise their rules might not be enforced in user testing, thus making their testing less useful.

  To still allow tests to check pre-softfork rules, a runtime argument can change the activation height.

ACKs for top commit:
  laanwj:
    Code review ACK fa4db8671b
  theStack:
    re-ACK fa4db8671b

Tree-SHA512: 6397d46ff56ebc48c007a4cda633904d6ac085bc76b4ecf83097c546c7eec93ac0c44b88083b2611b9091c8d1fb8ee1e314065de078ef15e922c015de7ade8bf
2021-09-24 14:04:51 +02:00
rajarshimaitra
efcaefc7b5
test: Add remaining scenarios of 0 waste
There are two more cases where waste can be 0, when:
 - (Fee - LTF) == -Change Cost
 - (Fee - LTF) == -Excess

Adding these two conditions explicitly in the unit test will help
pin the behavior, also demonstrate waste calculation scenarios to new
readers.
2021-09-24 15:36:58 +05:30
fanquake
4446ef0a54
build: remove support for weak linking getauxval()
It was [pointed out in #23030](https://github.com/bitcoin/bitcoin/pull/23030#issuecomment-922893367) that we might be able to get rid of our weak linking of [`getauxval()`](https://man7.org/linux/man-pages/man3/getauxval.3.html) (`HAVE_WEAK_GETAUXVAL`) entirely, with only Android being a potential holdout:
> I wonder if it's time to get rid of HAVE_WEAK_GETAUXVAL. I think it's confusing. Either we build against a C library that has this functionality, or not. We don't do this weak linking thing for any other symbols and recently got rid of the other glibc backwards compatibility stuff.
> Unless there is still a current platform that really needs it (Android?), I'd prefer to remove it from the build system, it has caused enough issues.

After looking at Android further, it would seem that given we are moving to using `std::filesystem`, which [requires NDK version 22 and later](https://github.com/android/ndk/wiki/Changelog-r22), and `getauxval` has been available in the since [API version 18](https://developer.android.com/ndk/guides/cpu-features#features_using_libcs_getauxval3), that shouldn't really be an issue. Support for API levels < 19 will be dropped with the NDK 24 release, and according to [one website](https://apilevels.com/), supporting API level 18+ will cover ~99% of devices. Note that in the CI we currently build with NDK version 22 and API level 28.

The other change in this PR is removing the include of headers for ARM intrinsics, from the check for strong `getauxval()` support in configure, as they shouldn't be needed. Including these headers also meant that the check would basically only succeed when building for ARM. This would be an issue if we remove weak linking, as we wouldn't detect `getauxval()` as supported on other platforms. Note that we also use `getauxval()` in our RNG when it's available.

I've checked that with these changes we detect support for strong `getauxval()` on Alpine (muslibc). On Linux, previously we'd be detecting support for weak getauxval(), now we detect strong support. Note that we already require glibc 2.17, and `getauxval()` was introduced in `2.16`.

This is an alternative / supersedes #23030.
2021-09-24 15:40:04 +08:00
Jarol Rodriguez
8177578b29 qt: ensure seperator when adding third-party transaction links
This ensures that if we're going to add an action to open up
a transaction in a third-party link (block explorer) that it
is seperated into it's own section.
2021-09-24 02:55:00 -04:00
Jarol Rodriguez
a70a98075a qt: improve text for open third-party tx url action
The text for an open third-party tx URL action
is improved by appending the host name with "Show in".
This makes it self-explanatory what the action will do.
2021-09-23 22:56:39 -04:00
W. J. van der Laan
b7e3600815
Merge bitcoin/bitcoin#21526: validation: UpdateTip/CheckBlockIndex assumeutxo support
673a5bd337 test: validation: add unittest for UpdateTip behavior (James O'Beirne)
2705570109 test: refactor: separate CreateBlock in TestChain100Setup (James O'Beirne)
298bf5d563 test: refactor: declare NoMalleation const auto (James O'Beirne)
071200993f move-only: unittest: add test/util/chainstate.h (James O'Beirne)
8f5710fd0a validation: fix CheckBlockIndex for multiple chainstates (James O'Beirne)
5a807736da validation: insert assumed-valid block index entries into candidates (James O'Beirne)
01a9b8fe71 validation: set BLOCK_ASSUMED_VALID during snapshot load (James O'Beirne)
42b2520db9 chain: add BLOCK_ASSUMED_VALID for use with assumeutxo (James O'Beirne)
b217020df7 validation: change UpdateTip for multiple chainstates (James O'Beirne)
665072a36d doc: add comment for g_best_block (James O'Beirne)
ac4051d891 refactor: remove unused assumeutxo methods (James O'Beirne)
9f6bb53935 validation: add chainman ref to CChainState (James O'Beirne)

Pull request description:

  This is part of the [assumeutxo project](https://github.com/bitcoin/bitcoin/projects/11) (parent PR: #15606)

  ---

  Modify UpdateTip and CheckBlockIndex for use with multiple chainstates. Includes a new unittest verifying `g_best_block` behavior (previously untested at the unit level) and various changes necessary for running and testing `ProcessNewBlock()`-like behavior on the background validation chainstate.

  This changeset introduces a new block index `nStatus` flag called `BLOCK_ASSUMED_VALID`, and it is applied to block index entries that are beneath the UTXO snapshot base block upon snapshot load. Once each block is validated (during async background validation), the flag is removed. This allows us to avoid (ab)using `BLOCK_VALID_*` flags for snapshot chain block entries, and preserves the original meaning of those flags.

  Note: this PR previously incorporated changes to `LoadBlockIndex()` and `RewindBlockIndex()` as noted in Russ' comments below, but once I generated the changes necessary to test the UpdateTip change, I decided to split this changes out into another PR due to the size of this one.

ACKs for top commit:
  achow101:
    ACK 673a5bd337
  jonatack:
    Code-review re-ACK 673a5bd337 reviewed diff, rebased to master/debug build/ran unit+functional tests
  naumenkogs:
    ACK 673a5bd337
  fjahr:
    Code review ACK 673a5bd337
  ariard:
    utACK 673a5bd3
  ryanofsky:
    Code review ACK 673a5bd337. Just linker fix and split commit changes mentioned https://github.com/bitcoin/bitcoin/pull/21526#issuecomment-921064563 since last review
  benthecarman:
    ACK 673a5bd337

Tree-SHA512: 0a6dc23d041b27ed9fd0ee1f3e5971b92fb1d2df2fc9b655d5dc48594235321ab1798d06de2ec55482ac3966a9ed56de8d56e9e29cae75bbe8690bafc2dda383
2021-09-23 22:22:07 +02:00
W. J. van der Laan
d8b4b3077f
Merge bitcoin/bitcoin#23057: log: Consolidate timedata logging
64e1ddd255 log: call LogPrint only once with time data samples (Martin Zumsande)

Pull request description:

  When timedata samples are logged, `LogPrint()` is currently invoked multiple times on the same log entry.
  This can lead to chaos in the log when other threads log concurrently, as in this example which motivated this PR:
  ```
  2021-09-20T00:28:57Z -48  -26  -11  -8  -6  Addrman checks started: new 37053, tried 83, total 37136
  2021-09-20T00:28:57Z -3  -1  -1  -1  -1  +0  |  nTimeOffset = -3  (+0 minutes)
  ```
  Fix this by building the log message in a string and logging it one `LogPrint()` call. I also changed the wording slightly so that it becomes understandable what is being logged, example:

  ```
  2021-09-21T21:03:24Z time data samples: -43  -18  -12  -4  -1  -1  +0  +0  +268  |  median offset = -1  (+0 minutes)
  ```

ACKs for top commit:
  jnewbery:
    Tested ACK 64e1ddd255
  laanwj:
    Tested ACK 64e1ddd255, new message lgtm

Tree-SHA512: ffb7a93166cc8fd6a39200b9e03a9d1e8e975b7ded822ccddd015f553258b991162a5cb867501f426d3ebcfef4f32f0e06e17b18e6b01486b967595d102f8379
2021-09-23 16:55:47 +02:00
merge-script
95b16e70a8
Merge bitcoin/bitcoin#23072: log: Remove unnecessary timing of Callbacks bench
ab27800799 log: Remove unnecessary timing logs for Callbacks bench (Douglas Chimento)

Pull request description:

  Logging of Callbacks are no longer needed and records times that are not relevant for performance analysis.
  resolves #23071

ACKs for top commit:
  laanwj:
    Thanks. re-ACK ab27800799
  jonatack:
    Code review ACK ab27800799

Tree-SHA512: be1ea780c4db9407a8799065a8824b9d3610abac72af5907809ed62d493d5a54e65735de45ec5fdd0edb85ef21ec6036105abe8ca00093942980f6f92e7fec50
2021-09-23 15:07:16 +02:00
Douglas Chimento
ab27800799 log: Remove unnecessary timing logs for Callbacks bench
Logging of Callbacks are no longer needed and records events that are not relevant for performance analysis.
2021-09-23 14:36:16 +03:00
fanquake
8bda5e0988
Merge bitcoin/bitcoin#22855: RBF move 3/3: move followups + improve RBF documentation
0ef08f8bed add missing includes in policy/rbf (glozow)
c6abeb76fb make MAX_BIP125_RBF_SEQUENCE constexpr (glozow)
3cf46f6055 [doc] improve RBF documentation (glozow)
c78eb8651b [policy/refactor] pass in relay fee instead of using global (glozow)

Pull request description:

  Followups to #22675 and documentation-only changes intended to clarify the code/logic concerning mempool Replace-by-Fee.

ACKs for top commit:
  jnewbery:
    utACK 0ef08f8bed
  fanquake:
    ACK 0ef08f8bed

Tree-SHA512: 6797ae758beca0c9673cb00ce85da48e9a4ac5cb5100074ca93e004cdb31d24d91a1a7721b57fc2f619addfeb4950d8caf45fee0f5b7528defbbd121eb4d271f
2021-09-23 16:40:41 +08:00
fanquake
3120bceeaf
Merge bitcoin/bitcoin#23054: Use C++11 member initializer in CTxMemPoolEntry
fa08d4cfb1 Use C++11 member initializer in CTxMemPoolEntry (MarcoFalke)

Pull request description:

  This removes a bunch of boilerplate, makes the code easier to read.
  Also, C++11 member initialization avoids accidental uninitialized
  members.

  Can be reviewed with the git option "--word-diff-regex=." or with "git
  difftool --tool=meld".

ACKs for top commit:
  jnewbery:
    Code review ACK fa08d4cfb1
  shaavan:
    Code Review ACK fa08d4cfb1

Tree-SHA512: 2424861002fbcef2a3f01845662c115b973a7a5103f359305b5d9237c055eb003aa7646fc1cb30e6eaf90810d662f94cedc6f90795e30b56680f9c81f631d64b
2021-09-23 16:11:54 +08:00
fanquake
faecb2ee0a
Merge bitcoin/bitcoin#22798: doc: Fix RPC result documentation
fa10fbc665 doc: Fix RPC result documentation (MarcoFalke)

Pull request description:

  Fix:
  * Incorrectly named fields
  * Add missing ones
  * Add missing optional flag

ACKs for top commit:
  fanquake:
    ACK fa10fbc665

Tree-SHA512: 2b302e6f7ac8253a55882bc032ddda1932b728abddd12b0adb5fba814b12fb998a67b91e6dd124ebbe0ac16dccdace01332ade01c1dc00a3768647118dd3a2d2
2021-09-23 15:52:22 +08:00
Jarol Rodriguez
9980f4aa5e qt, refactor: simplify third-party tx url action through overload
Simplify the creation, addition, and slot/signal connection of
a third part tx url context menu action by using an overloaded
addAction function.
2021-09-23 03:17:47 -04:00
Martin Zumsande
64e1ddd255 log: call LogPrint only once with time data samples
This prevents malformed log entries caused by other threads
logging concurrently.
2021-09-22 22:44:42 +02:00
merge-script
971cad475f
Merge bitcoin/bitcoin#23044: refactor: Remove unused validation includes
fa45a1338a refactor: Remove unused validation includes (MarcoFalke)

Pull request description:

  Unused includes will cause needless recompilation when headers are changed. Also, they pretend there are dependencies that don't exist.

  Fix both by removing them.

ACKs for top commit:
  laanwj:
    Code review ACK fa45a1338a
  theStack:
    ACK fa45a1338a ♻️

Tree-SHA512: 69190fd09184b75bce34ce3f315a1817e09ea32779f9ddc2d4790c89b0887b6cebd88aba66fa054c43c9183fc66202a556d982dd7034fc389a75802d8aaac83a
2021-09-22 12:38:13 +02:00
MarcoFalke
faff17bbde
Fix (inverse) meaning of -persistmempool 2021-09-22 11:29:44 +02:00
MarcoFalke
0000dca6f0
fuzz: Cleanup muhash fuzz target
Can be reviewed with -W --ignore-all-space

Fixes:
* Calling ConsumeRandomLengthByteVector 4 times, when 2 is enough.
* Slow execution speed: Finalize is expensive because it invokes
  division. Speed up the target by calling Finalize() at most twice per
  fuzz input.
2021-09-22 10:39:08 +02:00
Jarol Rodriguez
4832737c7d qt: connection type translator comments
Introduce Qt translator comments for connection types.
2021-09-21 23:33:21 -04:00
MarcoFalke
fa08d4cfb1
Use C++11 member initializer in CTxMemPoolEntry
This removes a bunch of boilerplate, makes the code easier to read.
Also, C++11 member initialization avoids accidental uninitialized
members.

Can be reviewed with the git option "--word-diff-regex=." or with "git
difftool --tool=meld".
2021-09-21 16:04:27 +02:00
Martin Ankerl
e148a52332
bench: fixed ubsan implicit conversion
The benchmarks can now run much longer due to the minimum of 10ms or
directly with -min_time. With -min_time=20000 I could trigger two ubsan
errors in the benchmarks, which are fixed in this commit by using
unsigned type and adding "& 0xFF".
2021-09-21 14:45:49 +02:00
Jon Atack
da4e2f1da0
bench: various args improvements
- use ALLOW_BOOL for -list arg instead of ALLOW_ANY
- touch up `-asymptote=<n1,n2,n3...>` help
- pack Args struct a bit more efficiently
- handle args in alphabetical order
2021-09-21 14:45:49 +02:00
Jon Atack
d312fd94a1
bench: clean up includes
Drops unneeded and adds missing includes
2021-09-21 14:45:49 +02:00
Martin Ankerl
1f10f1663e
bench: add usage description and documentation
This adds some usage description with tips to `bench_bitcoin -h`.
2021-09-21 14:45:49 +02:00
Martin Ankerl
d3c6f8bfa1
bench: introduce -min_time argument
When it is not easily possible to stabilize benchmark machine and code
the argument -min_time can be used to specify a minimum duration
that a benchmark should take. E.g. choose -min_time=1000 if you
are willing to wait about 1 second for each benchmark result.

The default is now set to 10ms instead of 0, which should make runs on
fast machines more stable with negligible slowdown.
2021-09-21 14:45:48 +02:00
Martin Ankerl
9fef832932
bench: make EvictionProtection.* work with any number of iterations
Moves copying of the setup into the benchmark loop so it is possible
to run the loop for an arbitrary number of times.

The overhead due to copying the candidates inside the loop is about 3%.
2021-09-21 14:45:48 +02:00
Martin Ankerl
153e6860e8
bench: change AddrManGood to AddrManAddThenGood
Moves some of the setup into the benchmark loop so it is possible to run
the loop for an arbitrary number of times. Due to recent optimizations
in #22974 the benchmark now runs much faster, so the inner loop now calls
Good() 32 times as often to get better numbers.

Renamed the benchmark to AddrManAddThenGood because that's now what is
actually tested. To get the the number of just Good(), one needs to
subtract the benchmark result of AddrManAdd.
2021-09-21 14:45:48 +02:00
Martin Ankerl
468b232f71
bench: remove unnecessary & incorrect multiplication in MuHashDiv
Introduced in #19055, MuHashDiv benchmark used to multiply with a loop
based on epochIterations. That does not do what it is supposed to do,
because epochIterations() is determined automatically from nanobench.

Also, multiplication is not needed for the algorithm (as pointed out by
a comment in #19055), so it's better to remove this loop.
2021-09-21 11:46:01 +02:00
Martin Ankerl
eed99cf272
bench: update nanobench from 4.3.4 to 4.3.6
Most importantly, this update fixes a bug in nanobench that always
disabled performance counters on linux.

It also adds another sanitizer suppression that is caught in clang++ 12.
2021-09-21 11:46:01 +02:00
MarcoFalke
fa10fbc665
doc: Fix RPC result documentation 2021-09-21 11:13:29 +02:00
MarcoFalke
fa3669f72f
fuzz: Move all addrman fuzz targets to one file
Can be reviewed with --color-moved=dimmed-zebra
2021-09-21 10:09:56 +02:00
MarcoFalke
fa7a883f5a
addrman: Replace assert with throw on corrupt data
Assert should only be used for program internal logic errors, not to
sanitize external user input.
2021-09-21 10:09:45 +02:00
MarcoFalke
fa298971e6
Refactor: Turn the internal addrman check helper into a forced check 2021-09-21 10:07:48 +02:00
MarcoFalke
fae5c633dc
move-only: Move CAddrMan::Check to cpp file
This speeds up compilation of the whole program because the included
header file is smaller.

Can be reviewed with --color-moved=dimmed-zebra --color-moved-ws=ignore-all-space
2021-09-21 10:07:38 +02:00
merge-script
223ad2fd0d
Merge bitcoin/bitcoin#22831: test: add addpeeraddress "tried", test addrman checks on restart with asmap
cdaab90662 Add test for addrman consistency check on restart with asmap (Jon Atack)
869f136816 Add test for rpc addpeeraddress with "tried" argument (Jon Atack)
ef242f5213 Allow passing "tried" to rpc addpeeraddress to call CAddrMan::Good() (Jon Atack)

Pull request description:

  This pull adds a `tried` argument to RPC addpeeraddress and a regression test for the recent addrman/asmap changes and issue.

  PR #22697 introduced a reproducible bug in commit 181a1207 that fails addrman consistency checks and causes it to significantly lose peer entries when the `-asmap` configuration option is used.

  The issue occurs upon bitcoind restart due to an initialization order change in `src/init.cpp` in that commit, whereby CAddrman asmap is set after deserializing `peers.dat`, rather than before.

  Issue reported on the `#bitcoin-core-dev` IRC channel starting at https://www.erisian.com.au/bitcoin-core-dev/log-2021-08-23.html#l-263.

  ```
  addrman lost 22813 new and 2 tried addresses due to collisions or invalid addresses
  ADDRMAN CONSISTENCY CHECK FAILED!!! err=-17 bitcoind: ./addrman.h:707: void CAddrMan::Check() const: Assertion `false' failed. Aborted
  ```

  How to reproduce:

  - `git checkout 181a1207`, build, and launch bitcoind with the `-asmap` and `-checkaddrman=1` configuration options enabled
  - restart bitcoind
  - bitcoind aborts on the second call to the addrman consistency checks in `CAddrMan::Check()`

  How to test this pull:

  - `git checkout 181a1207`, cherry pick the first commit of this branch, build, git checkout this branch, run `test/functional/rpc_net.py`, which should pass, and then run `test/functional/feature_asmap.py`, which should fail with the following output:

  ```
  AssertionError: Unexpected stderr bitcoind: ./addrman.h:739: void CAddrMan::Check() const: Assertion `false' failed.
  ```

ACKs for top commit:
  jnewbery:
    utACK cdaab90662
  mzumsande:
    re-ACK cdaab90662 (based on code review of diff to d586817)
  vasild:
    ACK cdaab90662

Tree-SHA512: 0251a18fea629b62486fc907d7ab0e96c6df6fadb9e4d62cff018bc681afb6ac31e0e7258809c0a88f91e4a36c4fb0b16ed294ce47ef30585217de89c3342399
2021-09-21 09:34:28 +02:00
merge-script
eb180d807a
Merge bitcoin/bitcoin#23050: log: change an incorrect fee to fee rate, and vice-versa
c17f554fcc Fix BlockAssembler::AddToBlock, CTxMemPool::PrioritiseTransaction logging (Jon Atack)

Pull request description:

  This is a tale of two fees, er, fee rates... indeed, one is misdescribed as a fee, and the other is incorrectly called a fee rate.

  From this review discussion: https://github.com/bitcoin/bitcoin/pull/22689#discussion_r695866211 (thanks to John Newbery).

ACKs for top commit:
  laanwj:
    Code review ACK c17f554fcc

Tree-SHA512: 3d9df3209a72562c5f9bbf815923d5b089d04491b8d19caa2c04158c501b47ef01e47f1c32d89adcbaf3c6357329507f65b4bb2963214c3451bbfa61ac812530
2021-09-21 09:18:01 +02:00
fanquake
1260b7e483
Merge bitcoin/bitcoin#23001: doc: Enable TLS in links in documentation
9bdda50151 Enable TLS in links in documentation (Jeremy Rand)

Pull request description:

  This PR enables TLS in several documentation links, which improves security.

ACKs for top commit:
  fanquake:
    ACK 9bdda50151

Tree-SHA512: 9d04d8771a9daf3c3b9914ff324e2eabfdf3ff5ae7f7dc92b84a1f3527010ceb860e73873a8f24d6051763eb472d9ea324ccbd6129a40318a520ca88c05f0586
2021-09-21 14:47:05 +08:00
Jon Atack
c17f554fcc
Fix BlockAssembler::AddToBlock, CTxMemPool::PrioritiseTransaction logging 2021-09-20 22:40:15 +02:00
W. J. van der Laan
7f7bd3111c
Merge bitcoin/bitcoin#22974: addrman: Improve performance of Good
57ce20307e fuzz: allow lower number of sources (Martin Zumsande)
acf656d540 fuzz: Use public interface to fill addrman tried tables (Martin Zumsande)
eb2e113df1 addrman: Improve performance of Good (Martin Zumsande)

Pull request description:

  Currently, `CAddrman::Good()` is rather slow because the process of moving an addr from new to tried involves looping over the new tables twice:
  1) In `Good_()`, there is a loop searching for a new bucket the addr is currently in, but this information is never used except for aborting if it is not found anywhere (since [this commit](e6b343d880 (diff-49d1faa58beca1ee1509a247e0331bb91f8604e30a483a7b2dea813e6cea02e2R263)) it is no longer passed to `MakeTried`)
  This is unnecessary because in a non-corrupted addrman, an address that is not in New must be either in Tried or not at all in addrman, both cases in which we'd return early in `Good_()` and never get to this point.
  I removed this loop (and left a check for `nRefCount` as a belt-and-suspenders check).

  2) In `MakeTried()`, which is called from `Good_()`, another loop removes all instances of this address from new. This can be spedup by stopping the search at  `nRefCount==0`. Further reductions in `nRefCount` would only lead to an assert anyway.
  Moreover, the search can be started at the bucket determined by the source of the addr for which `Good` was called, so that if it is present just once in New, no further buckets need to be checked.

  While calls to `Good()` are not that frequent normally, the performance gain is clearly seen in the fuzz target `addman_serdeser`, where, because of the slowness in creating a decently filled addrman, a shortcut was created that would directly populate the tried tables by reaching into addrman's internals, bypassing `Good()` (#21129).
  I removed this workaround in the second commit: Using `Good()` is still slower by a factor of 2 (down from a factor of ~60 before), but I think that this compensated by the advantages of not having to reach into the internal structures of addrman  (see https://github.com/jnewbery/bitcoin/pull/18#issuecomment-775218676).

  [Edit]: For benchmark results see https://github.com/bitcoin/bitcoin/pull/22974#issuecomment-919435266 and https://github.com/bitcoin/bitcoin/pull/22974#issuecomment-920445700 - the benchmark `AddrManGood` shows a significant speedup by a factor >100.

ACKs for top commit:
  naumenkogs:
    ACK 57ce20307e
  jnewbery:
    ACK 57ce20307e
  laanwj:
    Code review ACK 57ce20307e
  theStack:
    ACK 57ce20307e
  vasild:
    ACK 57ce20307e

Tree-SHA512: fb6dfc198f2e28bdbb41cef9709828f22d83b4be0e640a3155ca42e771b6f58466de1468f54d773e794f780a79113f9f7d522032e87fdd75bdc4d99330445198
2021-09-20 19:47:55 +02:00
W. J. van der Laan
488e745560
Merge bitcoin/bitcoin#12677: RPC: Add ancestor{count,size,fees} to listunspent output
6cb60f3e6d doc/release-notes: Add new listunspent fields (Luke Dashjr)
0be2f17ef5 QA: Add tests for listunspent ancestor{count,size,fees} to mempool_packages (Luke Dashjr)
6966e80f45 RPC: Add ancestor{count,size,fees} to listunspent output (Luke Dashjr)
3f77dfdaf0 Expose ancestorsize and ancestorfees via getTransactionAncestry (Luke Dashjr)

Pull request description:

  Requested by a user

ACKs for top commit:
  prayank23:
    reACK 6cb60f3e6d
  fjahr:
    Code review re-ACK 6cb60f3e6d
  kiminuo:
    ACK [6cb60f3](6cb60f3e6d)
  achow101:
    Code Review ACK 6cb60f3e6d
  naumenkogs:
    ACK 6cb60f3e6d
  darosior:
    utACK 6cb60f3e6d

Tree-SHA512: 5d16e5799558691e5853ab7ea2cc85514cb45da3ce69134d855c71845beef32ec6af5ab28d4462683e9800c8ea126f162773a9d3d5660edac08fd8edbfeda173
2021-09-20 19:25:43 +02:00
glozow
0ef08f8bed add missing includes in policy/rbf 2021-09-20 13:34:48 +01:00
glozow
c6abeb76fb make MAX_BIP125_RBF_SEQUENCE constexpr 2021-09-20 13:32:28 +01:00
klementtan
7c3712fa32
cli: Display all proxies in -getinfo 2021-09-20 18:52:04 +08:00
MarcoFalke
fa45a1338a
refactor: Remove unused validation includes 2021-09-20 12:16:20 +02:00
practicalswift
4747db8761 util: Introduce ToIntegral<T>(const std::string&) for locale independent parsing using std::from_chars(…) (C++17)
util: Avoid locale dependent functions strtol/strtoll/strtoul/strtoull in ParseInt32/ParseInt64/ParseUInt32/ParseUInt64

fuzz: Assert equivalence between new and old Parse{Int,Uint}{8,32,64} functions

test: Add unit tests for ToIntegral<T>(const std::string&)
2021-09-18 04:31:24 +00:00
Sjors Provoost
dc10ca346b
net: switch to signet DNS seed
This commit also drops a seed node that no longer exists.
2021-09-17 21:22:32 +02:00
merge-script
e69cbac628
Merge bitcoin/bitcoin#22896: refactor: net: avoid duplicate map lookups to mapLocalHost
330d3aa1a2 refactor: net: avoid duplicate map lookups to `mapLocalHost` (Sebastian Falbesoner)

Pull request description:

  This simple refactoring PR aims to avoid duplicate lookups to `mapLocalHost`: instead of calling `count()` (to first find out whether a key is in the map) and then `operator[]` (to get the value to the passed key, or default-construct one if not found), use either
  * `find()` and dereference the returned iterator (for simple lookups), see https://www.cplusplus.com/reference/map/map/find/
  * `emplace()` and use the returned <iterator, inserted> pair (for lookups where a new element should be inserted if the key isn't found), see https://www.cplusplus.com/reference/map/map/emplace/

ACKs for top commit:
  naumenkogs:
    ACK 330d3aa1a2
  jonatack:
    Code review ACK 330d3aa1a2 plus rebase to master + debug build

Tree-SHA512: d13da6a927ff561eee8ac6b093bf3586dfe31d6c94173a5a6d8f3698e0ee224fb394d3635155d5141c165da59d2c2c37260122eb4f2e8bcda3e8a29b901d213e
2021-09-17 14:25:10 +02:00