Commit graph

30951 commits

Author SHA1 Message Date
fanquake
863e52fe63
consensus: make COIN & MAX_MONEY constexpr 2021-09-30 07:42:00 +08:00
fanquake
d09071da5b
[MOVEONLY] consensus: move amount.h into consensus
Move amount.h to consensus/amount.h.
Renames, adds missing and removes uneeded includes.
2021-09-30 07:41:57 +08:00
Samuel Dobson
dc3ec74d67 Add rescan removal release note 2021-09-30 12:06:27 +13:00
Samuel Dobson
bccd1d942d Remove -rescan startup parameter 2021-09-30 12:06:27 +13:00
Samuel Dobson
f963b0fa8c Corrupt wallet tx shouldn't trigger rescan of all wallets 2021-09-30 12:06:27 +13:00
Andrew Chow
d5cfb864ae Allow Coin Selection be able to take external inputs 2021-09-29 16:48:43 -04:00
Andrew Chow
a00eb388e8 Allow CInputCoin to also be constructed with COutPoint and CTxOut 2021-09-29 16:48:43 -04:00
Hennadii Stepanov
489060dcaf
qt: Do not show unused widgets at startup
When starting without wallets the labelWalletEncryptionIcon and
labelWalletHDStatusIcon widgets are not required.
2021-09-29 21:57:07 +03:00
MarcoFalke
2222c04e1b
log: Adjust coin selection log string
Replace the outdated function name with words from the English language.
Logging the function name can be toggled with -logsourcelocations.
2021-09-29 18:49:20 +02:00
MarcoFalke
fa6c1e850f
test: Fix typos in tests 2021-09-29 18:47:45 +02:00
MarcoFalke
faeae2980f
log: Avoid broken DEBUG_LOCKORDER log 2021-09-29 18:46:30 +02:00
MarcoFalke
419afa9341
Merge bitcoin/bitcoin#23064: fuzz: Fix memory leak in system fuzz target
aaaa37abba fuzz: Fix memory leak in system fuzz target (MarcoFalke)

Pull request description:

  Might fix https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=36906

  To test:

  ```
  $ FUZZ=system valgrind --tool=massif ./src/test/fuzz/fuzz ../btc_qa_assets/fuzz_seed_corpus/system/
  ^C
  $ massif-visualizer ./massif.out.952024
  ```

ACKs for top commit:
  practicalswift:
    cr ACK aaaa37abba

Tree-SHA512: 6aa47ea12ec76133ae326ed41c31414d7a418abe1f28b05f698e9bb5439bbe26b814c4827999b15b77b47608dbc71c9b35789d0b84e25f56928381d06d6460e5
2021-09-29 17:58:50 +02:00
Shubhankar
74c0d81b46 test: use miniwallet in test_rpc() function in feature_rbf.py 2021-09-29 20:43:45 +05:30
Hennadii Stepanov
8d83f9c1d1
Merge bitcoin-core/gui#436: Include vout when copying transaction ID from coin selection
10c6929d55 Include vout when copying transaction ID from coin selection (Samuel Dobson)

Pull request description:

  Fixes #432

  I think it makes sense to just add the vout to the existing function because I can't imagine a situation where a user in the coin selection dialog would want just the transaction ID rather than the specific outpoint, and they can just delete it from the end anyway.

ACKs for top commit:
  kristapsk:
    ACK 10c6929d55
  hebasto:
    ACK 10c6929d55, tested on Linux Mint 20.2 (Qt 5.12.8).
  shaavan:
    ACK 10c6929

Tree-SHA512: df4d132b6c2fd0b590594e91cf54f82c6c0f77ee9ca06296fb726bc3c52b9ae459ca3b50c48b2bf303ccafe832b6b4dba692a812f439991ca6d807ea0d8df934
2021-09-29 17:27:02 +03:00
Hennadii Stepanov
451ca244db
qt, refactor: Drop intermediate BitcoinApplication::shutdownResult slot 2021-09-29 17:02:00 +03:00
Hennadii Stepanov
f3a17bbe5f
qt: Do not exit and re-enter main event loop during shutdown 2021-09-29 17:01:49 +03:00
MarcoFalke
829c441af2
Merge bitcoin/bitcoin#23115: bloom: use Span instead of std::vector for insert and contains
a11da75411 bloom: cleanup includes (fanquake)
f1ed1d3194 bloom: use constexpr where appropriate (fanquake)
2ba4ddf31d bloom: use Span instead of std::vector for `insert` and `contains` (William Casarin)

Pull request description:

  This is #18985 rebased, with the most recent comments addressed.

  > 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.

ACKs for top commit:
  sipa:
    Code review ACK a11da75411
  laanwj:
    Code review ACK a11da75411

Tree-SHA512: ee9ba02c9588daa1ff51782d1953fd060839dd15aa85861b2633b6ff2398320188ddd00f01d0c99442224485364ede9f8322366de4239fc7831ebfa06bd34659
2021-09-29 15:19:07 +02:00
MarcoFalke
fac1c13ead
Update crc32c subtree 2021-09-29 14:10:29 +02:00
MarcoFalke
1d44513f9b Squashed 'src/crc32c/' changes from b5ef9be675..0d624261ef
0d624261ef Merge bitcoin-core/crc32c#2: Merge upstream
cac7ca830b Merge commit 'fa5ade41ee480003d9c5af6f43567ba22e4e17e6' into bitcoin-fork
fa5ade41ee Fix compilation warnings on ARM64 with old GCC versions. (#52)
db08d22129 Updated Travis-CI configuration. (#51)
e31619a5b7 Fix GitHub links. (#50)
7fa4c263e8 Update Travis CI config. (#49)
a3d9e6d1a4 Updated third_party/ and Travis CI config. (#48)

git-subtree-dir: src/crc32c
git-subtree-split: 0d624261ef83ab08c953c196540ed18f355add4c
2021-09-29 14:09:01 +02:00
MarcoFalke
d648bbb0a7
Merge bitcoin/bitcoin#23124: Fix feature_segwit.py failure due to witness
b207971465 Fix feature_segwit failure due to witness (Samuel Dobson)

Pull request description:

  Fixes #23116

  The failure is due to sometimes spending segwit outputs, which add an additional 1 sigop in the witness, added to the 2 (*4) in the outputs.

ACKs for top commit:
  brunoerg:
    tACK b207971465

Tree-SHA512: 7e3c09d162e6941a3028514e95ae3aab2a3f858e2f056229c5faff5e37ece897dc63e3f8c0e07fad9fc4621b74a6dee5ff777e910b2b009a41bb6e72a09217bd
2021-09-29 13:36:19 +02:00
MarcoFalke
aaaa37abba
fuzz: Fix memory leak in system fuzz target 2021-09-29 13:24:14 +02:00
Hennadii Stepanov
ba1a82e608
Merge bitcoin-core/gui#430: Improvements to the open up transaction in third-party link action
2ccde2f932 qt: hyphenate usage of third-party modifier (Jarol Rodriguez)
8177578b29 qt: ensure seperator when adding third-party transaction links (Jarol Rodriguez)
a70a98075a qt: improve text for open third-party tx url action (Jarol Rodriguez)
9980f4aa5e qt, refactor: simplify third-party tx url action through overload (Jarol Rodriguez)

Pull request description:

  [#4092](https://github.com/bitcoin/bitcoin/pull/4092) introduced the ability to open up a transaction in a block explorer. This improves the related code by simplifying the addition and connection of the action through an [overloaded](https://doc.qt.io/archives/qt-5.9/qmenu.html#addAction-5) `addAction` function and prepends action description text to the host, "Show in". The reason to add this text is to make it clear what the action does. It also creates a clearer mental correlation between a user doing the work to add the 3rd-party tx link and this new menu action popping up.

  This updates the setting text so that "third-party" is hyphenated. It should be hyphenated because it is being used as a modifier of both "URL" and "transaction URLs".

  Additionally, this fixes #431 by ensuring that the seperator will be added before creating action.

  Screenshots of visual changes:

  **Context menu actions**
  |   master   |   pr   |
  |--------------|--------|
  | <img width="248" alt="3pt-master" src="https://user-images.githubusercontent.com/23396902/134618354-00278ac6-5094-44ee-8ba7-fe648fdcb7d2.png"> | <img width="248" alt="3pt-pr" src="https://user-images.githubusercontent.com/23396902/134618364-ddb64269-e5ee-40af-a2a6-1922001b6f4e.png"> |

  **Setting text**
  (tooltip text containing usage of "third-party" is also properly hyphenated)
  |   master   |   pr   |
  |--------------|--------|
  | ![unnamed](https://user-images.githubusercontent.com/23396902/134854070-fb299ba5-3491-487f-b37f-c0cd96514353.png) | ![pr-hyphenate](https://user-images.githubusercontent.com/23396902/134854127-88630cc2-a178-4376-a569-f413f66eba0d.png) |

ACKs for top commit:
  stratospher:
    tested ACK 2ccde2f.
  promag:
    Code view ACK 2ccde2f932.
  hebasto:
    ACK 2ccde2f932

Tree-SHA512: 8dfcd539a1d41c8abf3c8208d150d1480d4ef81a008de826299e8bad1dfa6e3c49dc76d041c5946fafcf0b033eebb9b9fbd3d49ba6d8af93dd388c488e92f143
2021-09-29 13:18:26 +03:00
Hennadii Stepanov
ad47fb8b64
Merge bitcoin-core/gui#416: Add RPC setting
bd5c826a96 gui: add RPC setting (Sjors Provoost)

Pull request description:

  RPC access is disabled by default for the GUI.

  With the proliferation of third party desktop applications that use the Bitcoin Core RPC (e.g. Specter Desktop, Sparrow and Wasabi), this PR makes them slight easier to configure. It's no longer required to find and edit `bitcoin.conf` to add `server=1` to it.

  <img width="447" alt="Schermafbeelding 2021-09-02 om 14 25 58" src="https://user-images.githubusercontent.com/10217/131844201-be3b49a8-ae88-47e6-8992-e95ee6b70f69.png">

ACKs for top commit:
  hebasto:
    ACK bd5c826a96, tested on Linux Mint 20.2 (Qt 5.12.8):
  shaavan:
    reACK bd5c826a96
  promag:
    Code review ACK bd5c826a96. Just minor fixes to the .ui form since last review.

Tree-SHA512: ab377e2358826096b499013bc3a864b7b63dff9859e96041e93ff0897d2319a35e8b3adcfb8df5f83274466c83d040d4ea18c546699421425c835e6f42562ae0
2021-09-29 12:19:18 +03:00
Hennadii Stepanov
ccc4b9125a
Merge bitcoin-core/gui#345: Connection Type Translator Comments
4832737c7d qt: connection type translator comments (Jarol Rodriguez)

Pull request description:

  This PR introduces Qt translator comments for `Connection Type` strings in `guiutil.cpp` as well as `rpcconsole.cpp`.

  This is an alternate implementation of the idea presented in the last three commits of #289. It is especially inspired by commit 842f4e834dfe5fd2786a5092f78ea28da1b36e4f.

  Per [Qt Dev Notes](https://github.com/bitcoin-core/bitcoin-devwiki/wiki/Developer-Notes-for-Qt-Code), it is better to not break up strings when not necessary. This way we preserve the full context for translators.

ACKs for top commit:
  jonatack:
    Code review re-ACK 4832737c7d per `git diff 371e2b9 4832737`, changes are translator comment edits since my review yesterday (thank you for updating)
  hebasto:
    ACK 4832737c7d

Tree-SHA512: 67e1741e10a2e30cde6d50d3293eec89f0b7641b34463865dc6909d2926cdcf33a7d8c1dc8055d2f85906ad2002cdaa594d37b184d16e2f06614b6c5ad00c982
2021-09-29 11:58:15 +03:00
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
MarcoFalke
33e31f8df9
Merge bitcoin/bitcoin#23079: test: use MiniWallet for p2p_filter.py
cfdb6baa22 test: use MiniWallet for p2p_filter.py (Sebastian Falbesoner)
6fc2cd3f09 test: introduce helper to create random P2WPKH scriptPubKeys (Sebastian Falbesoner)
aa26797f69 test: MiniWallet: add `send_to` method to create arbitrary txouts (Sebastian Falbesoner)

Pull request description:

  This PR enables one more of the non-wallet functional tests (p2p_filter.py) to be run even with the Bitcoin Core wallet disabled by using the MiniWallet instead, as proposed in #20078.
  For this purpose, a MiniWallet method `send_to` is introduced first, which allows to create arbitrary outputs (scriptPubKey/amount). Note that the implementation for this is already present in feature_rbf.py (recently added in PR #22998), i.e. it is simply moved to the MiniWallet interface.

ACKs for top commit:
  laanwj:
    Code review ACK cfdb6baa22

Tree-SHA512: 13b063631f0d7af065b7757cfe8b47c9be6cb9850ac5db2968a2bba4f5a18cdc9f89173a9b03971545356225082042f5fdbe49d3036027d18e8b7eb042d04f5e
2021-09-29 09:13:07 +02:00
fanquake
2b90eae33c
doc: update developer docs for subtree renaming 2021-09-29 15:12:12 +08:00
MarcoFalke
8daecf4d1d
Merge bitcoin/bitcoin#23108: ci: Enable extended tests on native Windows
fa87230ec5 ci: Enable extended tests on native Windows (MarcoFalke)

Pull request description:

ACKs for top commit:
  hebasto:
    ACK fa87230ec5

Tree-SHA512: d1b15a572021462b52e900d91b89b6a9cb3451fc7d1aebf4272f856b78fa1382a170ef9b7fb54702ebe0b2e123e3b618375bcf99a390e57c2039cbab61fa9114
2021-09-29 08:26:20 +02:00
MarcoFalke
7d4ea7c7ef
Merge bitcoin/bitcoin#23120: test: Remove unused and confusing main parameter from script_util
fa54efda9b test: pep-8 touched test (MarcoFalke)
fa46768059 test: Remove unused and confusing main parameter from script_util (MarcoFalke)

Pull request description:

ACKs for top commit:
  fanquake:
    ACK fa54efda9b

Tree-SHA512: 124e888e16c92bb24ab4d6f68a768d295500a48f8c6c0b4f069493effcd761f80be78dd93b31edbb529ebe4c8aaca764aaff48d1e3b23659dde722981dc787a5
2021-09-29 08:08:25 +02:00
Samuel Dobson
b207971465 Fix feature_segwit failure due to witness 2021-09-29 17:41:35 +13: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