Commit graph

86 commits

Author SHA1 Message Date
Andrew Poelstra
7a7791e879 Merge 03b1db6114 into merged_master (Bitcoin PR #18766) 2021-06-11 16:59:19 +00:00
Andrew Poelstra
f8af0d7192 Merge cd720337fe into merged_master (Bitcoin PR #20222) 2021-06-10 18:30:29 +00:00
Antoine Poinsot
86ff2cf202
Remove the remaining fee estimation globals
This moves the CBlockPolicyEstimator to the NodeContext, which get rids
of two globals and allows us to conditionally create the
CBlockPolicyEstimator (and to remove a circular dep).

Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
2020-12-03 12:56:37 +01:00
Andrew Poelstra
5f5f4279ed Merge 1b313cacc9 into merged_master (Bitcoin PR #19927) 2020-11-29 21:07:46 +00:00
Andrew Poelstra
b657dd4a3a Merge 147d50d63e into merged_master (Bitcoin PR #19791) 2020-11-29 02:07:46 +00:00
Andrew Poelstra
2a0cf12ecc Merge 07087051af into merged_master (Bitcoin PR #19556)
Added a method testPeginClaimAcceptance to interfaces::CChain. It is not clear
to me that this is meaningfully different from the existing method broadcastTransaction
(with the `relay` flag set to false so it doesn't actually broadcast), except
that this method returns the TxValidationState, which we display to the user
in the RPC error. Worth revisiting this.

Another nonobvious change was replacing a block of mempool-searching logic
in wallet/rpcwallet.cpp with the single line `pwallet->chain().findCoins(coins)`.
This I stole from the current state of upstream #17211, our favorite in-progress
PR from which the original logic came.
2020-11-29 01:43:20 +00:00
Andrew Poelstra
a0c37112ef Merge 5c910a6b7a into merged_master (Bitcoin PR #19826) 2020-11-28 17:34:40 +00:00
Andrew Poelstra
ec3c13988a Merge 6a2ba62685 into merged_master (Bitcoin PR #19779) 2020-11-28 13:07:39 +00:00
Andrew Poelstra
5c26f38427 Merge 92735e45ba into merged_master (Bitcoin PR #19775) 2020-11-28 12:48:08 +00:00
Andrew Poelstra
5dd8b96340 Merge 4fefd80f08 into merged_master (Bitcoin PR #19704) 2020-11-28 04:18:46 +00:00
Andrew Poelstra
54668f0d50 Merge 4b705b1c98 into merged_master (Bitcoin PR #19098) 2020-11-27 02:59:49 +00:00
Andrew Poelstra
59aa4e1fba Merge ad2952d17a into merged_master (Bitcoin PR #19604) 2020-11-26 22:45:20 +00:00
Andrew Poelstra
12f11f8f70 Merge 2f71a1ea35 into merged_master (Bitcoin PR #18637) 2020-11-26 20:30:20 +00:00
Andrew Poelstra
7fabb1de9a Merge 5ec19df687 into merged_master (Bitcoin PR #19277) 2020-11-26 01:09:19 +00:00
Andrew Poelstra
5fcf5348d9 Merge e1b20e2285 into merged_master (Bitcoin PR #19028) 2020-11-26 01:09:17 +00:00
Andrew Poelstra
72283db549 Merge 3a4a3729d9 into merged_master (Bitcoin PR #19090) 2020-11-26 01:09:13 +00:00
Andrew Poelstra
29b17c1221 Merge 793e0ff22c into merged_master (Bitcoin PR #18698) 2020-11-26 01:08:49 +00:00
Andrew Poelstra
51965ad1e6 Merge 25ad2c623a into merged_master (Bitcoin PR #18740) 2020-11-26 01:08:47 +00:00
Andrew Poelstra
fd37b7c5d6 Merge 54f812d9d2 into merged_master (Bitcoin PR #18673) 2020-11-26 01:08:23 +00:00
Andrew Poelstra
2016bea80a Merge 544709763e into merged_master (Bitcoin PR #18571)
This resulted in double-initializing the asset directory (and from multiple
places), so I added a `ClearGlobalAssetDir` method and called it from the
qt test setup.
2020-11-26 01:08:20 +00:00
Andrew Poelstra
9ce236f051 Merge 10358a381a into merged_master (Bitcoin PR #17737) 2020-11-26 01:08:16 +00:00
Andrew Poelstra
e978e137dd Merge 4eb1eeb02c into merged_master (Bitcoin PR #18504) 2020-11-26 01:08:16 +00:00
Andrew Poelstra
5be76a4a3e Merge 3410fe6887 into merged_master (Bitcoin PR #18521) 2020-11-26 01:08:14 +00:00
Andrew Poelstra
5b3e849748 Merge 2e97d80017 into merged_master (Bitcoin PR #18134) 2020-11-26 01:08:02 +00:00
Andrew Poelstra
5aa6af6fa3 Merge 8662387309 into merged_master (Bitcoin PR #17997) 2020-11-26 01:07:56 +00:00
Andrew Poelstra
be6f250701 Merge f1064c1b0d into merged_master (Bitcoin PR #17989) 2020-11-26 01:07:52 +00:00
Andrew Poelstra
2d35bebf6b Merge 3516a31eaa into merged_master (Bitcoin PR #18234) 2020-11-26 01:07:50 +00:00
Andrew Poelstra
0246b86872 Merge 54a7ef612a into merged_master (Bitcoin PR #17399) 2020-11-26 01:07:48 +00:00
Andrew Poelstra
70819cbab4 Merge 36f42e1bf4 into merged_master (Bitcoin PR #18037) 2020-11-26 01:07:43 +00:00
Andrew Poelstra
75726e3bc3 Merge 40a495a38a into merged_master (Bitcoin PR #16975) 2020-11-14 16:52:05 +00:00
Andrew Poelstra
d9db3e9012 Merge 17e14ac92f into merged_master (Bitcoin PR #17781) 2020-11-14 16:52:03 +00:00
Andrew Poelstra
fcc3e6c04c Merge ae6943620a into merged_master (Bitcoin PR #17407) 2020-11-09 23:10:14 +00:00
Andrew Poelstra
54dd52556e Merge 772673dfbe into merged_master (Bitcoin PR #16978) 2020-11-09 23:10:08 +00:00
Andrew Poelstra
3f2190d870 Merge 7d14e35f3f into merged_master (Bitcoin PR #17342) 2020-11-09 23:10:08 +00:00
Andrew Poelstra
056b9bb06d Merge 46fc4d1a24 into merged_master (Bitcoin PR #17384) 2020-11-09 23:10:08 +00:00
Elle Mouton
e3310692d0 refactor: Make CTxMemPool::m_check_ratio a const and a constructor argument
Since m_check_ratio is only set once and since the CTxMemPool object is
no longer a global variable, m_check_ratio can be passed into the
constructor of CTxMemPool. Since it is only read from after
initialization, m_check_ratio can also be made a const and hence no
longer needs to be guarded by the cs mutex.
2020-10-23 14:41:30 +02:00
Carl Dong
74f73c783d
validation: Pass in chainman to UnloadBlockIndex 2020-09-15 14:11:34 -04:00
John Newbery
58bd369b0d scripted-diff: [net processing] Rename PeerLogicValidation to PeerManager
-BEGIN VERIFY SCRIPT-
sed -i 's/PeerLogicValidation/PeerManager/g' $(git grep -l PeerLogicValidation ./src ./test)
sed -i 's/peer_logic/peerman/g' $(git grep -l peer_logic ./src ./test)
-END VERIFY SCRIPT-

PeerLogicValidation was originally net_processing's implementation to
the validation interface. It has since grown to contain much of
net_processing's logic. Therefore rename it to reflect its
responsibilities.

Suggested in
https://github.com/bitcoin/bitcoin/pull/10756#pullrequestreview-53892618.
2020-09-07 11:15:48 +01:00
John Newbery
2297b26b3c [net_processing] Pass chainparams to PeerLogicValidation constructor
Keep a references to chainparams, rather than calling the global
Params() function every time it's needed. This is fine, since
globalChainParams does not get updated once it's been set, and it's
available at the point of constructing the PeerLogicValidation object.
2020-09-07 11:13:58 +01:00
MarcoFalke
fafb381af8
Remove mempool global 2020-09-05 16:24:56 +02:00
MarcoFalke
fa0572d0f3
Pass mempool reference to chainstate constructor 2020-08-28 10:42:04 +02:00
fanquake
6a2ba62685
Merge #19779: Remove gArgs global from init
fa9d5902f7 scripted-diff: gArgs -> args (MarcoFalke)
fa33bc2dab init: Capture copy of blocknotify setting for BlockNotifyCallback (MarcoFalke)
fa40017706 init: Pass reference to ArgsManager around instead of relying on global (MarcoFalke)

Pull request description:

  The gArgs global has several issues:

  * gArgs is used by each process (bitcoind, bitcoin-qt, bitcoin-wallet, bitcoin-cli, bitcoin-tx, ...), but it is hard to determine which arguments are actually used by each process. For example arguments that have never been registered, but are still used, will always return the fallback value.
  * Tests may run several sub-tests, which need different settings. So globals will have to be overwritten, but that is fragile on its own: e.g. https://github.com/bitcoin/bitcoin/pull/19704#issuecomment-678259092 or #19511

  The goal is to remove gArgs, but as a first step in that direction this pull will change gArgs in init to use a passed-in reference instead.

ACKs for top commit:
  ryanofsky:
    Code review ACK fa9d5902f7. Looks good. Nice day to remove some globals, and add some lambdas 👍
  fanquake:
    ACK fa9d5902f7 - I'm not as familiar with the settings & argument handling code, but this make sense, and is a step in the right direction towards a reduction in the usage of globals. Not a huge fan of the clang-formatting in the scripted diff.
  jonasschnelli:
    Concept ACK fa9d5902f7

Tree-SHA512: ed00db5f826566c7e3b4d0b3d2ee0fc1a49a6e748e04e5c93bdd694ac7da5598749e73937047d5fce86150d764a067d2ca344ba4ae3eb2704cc5c4fa0d20940f
2020-08-26 15:18:38 +08:00
fanquake
92735e45ba
Merge #19775: test: Activate segwit in TestChain100Setup
fad84b7e14 test: Activate segwit in TestChain100Setup (MarcoFalke)
fa11ff2980 test: Pass empty tx pool to block assembler (MarcoFalke)
fa96574b0d test: Move doxygen comment to header (MarcoFalke)

Pull request description:

  This fixes not only a TODO in the code, but also prevents a never ending source of uninitialized reads. E.g.

  * #18376
  * https://github.com/bitcoin/bitcoin/pull/19704#issuecomment-678259092
  * ...

ACKs for top commit:
  jnewbery:
    utACK fad84b7e14

Tree-SHA512: 64cf16a59656d49e022b603f3b06441ceae35a33a4253b4382bc8a89a56e08ad5412c8fa734d0fc7b58586f40ea6d57b348a3b4838bc6890a41ae2ec3902e378
2020-08-26 13:17:35 +08:00
MarcoFalke
fa40017706
init: Pass reference to ArgsManager around instead of relying on global 2020-08-24 07:45:17 +02:00
MarcoFalke
fad84b7e14
test: Activate segwit in TestChain100Setup 2020-08-21 18:44:52 +02:00
MarcoFalke
fa11ff2980
test: Pass empty tx pool to block assembler 2020-08-21 18:44:50 +02:00
MarcoFalke
fa96574b0d
test: Move doxygen comment to header
Also, unrelated formatting fixups.

Can be reviewed with --word-diff-regex=.
2020-08-21 18:44:27 +02:00
John Newbery
c556770b5e [net_processing] Change PeerLogicValidation to hold a connman reference
Hold a reference to connman rather than a pointer because:

- PeerLogicValidation can't run without a connman
- The pointer never gets reseated

The alternative is to always assert that the pointer is non-null before
dereferencing.

Change the name from connman to m_connman at the same time to conform
with current style guidelines.
2020-08-12 14:25:28 +01:00
MarcoFalke
4b705b1c98
Merge #19098: test: Remove duplicate NodeContext hacks
edc316020e test: Remove duplicate NodeContext hacks (Russell Yanofsky)

Pull request description:

  Qt tests currently are currently using two NodeContext structs at the same time, one in interfaces::NodeImpl::m_context, and the other in BasicTestingSetup::m_node, and the tests have hacks transferring state between them.

  Fix this by getting rid of the NodeImpl::m_context struct and making it a pointer. This way a common BitcoinApplication object can be used for all qt tests, but they can still have their own testing setups.

  Non-test code is changing but non-test behavior is still the same as before.

  Motivation for this PR is to be able to remove the "std::move(test.m_node.connman)" and mempool hacks for swapping individual NodeContext members in Qt tests, because followup PR #19099 adds yet another member (wallet_client) that needs to be swapped. After this change, the whole NodeContext struct can be swapped instead of individual members, so the workarounds are less fragile and invasive.

ACKs for top commit:
  MarcoFalke:
    crACK edc316020e 🌮
  promag:
    ACK edc316020e.

Tree-SHA512: c1650e4127f43a4020304ca7c13b5d9122fb5723aacd8fa1cf855d03c6052fcfb7685810aa2a5ef708561015f0022fecaacbad479295104ca45d2c17579466a4
2020-08-07 08:07:37 +02:00
MarcoFalke
fac674db20
Pass mempool pointer to UnloadBlockIndex 2020-07-29 12:29:51 +02:00