Skip to content

Conversation

@laanwj
Copy link
Member

@laanwj laanwj commented Apr 5, 2016

Builds on #7756 (only the last commit is specific here).
Break the circular dependency between main and txdb by:

  • Moving CBlockFileInfo from main.h to chain.h. I think this makes sense, as the other block-file stuff is there too.
  • Moving CDiskTxPos from main.h to txdb.h. This type, used for -txindex seems specific to txdb.
  • Pass a functor insertBlockIndex to LoadBlockIndexGuts. This leaves it up to the caller how to insert block indices.

@dcousens
Copy link
Contributor

dcousens commented Apr 6, 2016

concept ACK, will wait on rebase for review

@laanwj laanwj force-pushed the 2016_04_break_txdb_main_dep branch from bf75c95 to 699ea05 Compare April 6, 2016 10:20
@laanwj
Copy link
Member Author

laanwj commented Apr 6, 2016

Rebased

@jonasschnelli
Copy link
Contributor

Concept ACK

@paveljanik
Copy link
Contributor

ACK 699ea05 only

I haven't reviewed Cursor() changes...

Break the circular dependency between main and txdb by:

- Moving `CBlockFileInfo` from `main.h` to `chain.h`. I think this makes
  sense, as the other block-file stuff is there too.

- Moving `CDiskTxPos` from `main.h` to `txdb.h`. This type seems
  specific to txdb.

- Pass a functor `insertBlockIndex` to `LoadBlockIndexGuts`. This leaves
  it up to the caller how to insert block indices.
@laanwj laanwj force-pushed the 2016_04_break_txdb_main_dep branch from 699ea05 to 99e7075 Compare April 15, 2016 15:48
@laanwj
Copy link
Member Author

laanwj commented Apr 15, 2016

699ea05 rebased as 99e7075 (now that #7756 merged)


class CBlockIndex;
struct CDiskTxPos;
class CCoinsViewDBCursor;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+class CCoinsViewDBCursor; here and -class CCoinsViewDBCursor; later?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes I moved all pre-declarations to the top

@paveljanik
Copy link
Contributor

utACK 99e7075

Reviewing combined commits is a nightmare ;-)

Testing now.

@dcousens
Copy link
Contributor

utACK 99e7075

@sipa
Copy link
Member

sipa commented May 5, 2016

utACK 99e7075

@laanwj laanwj merged commit 99e7075 into bitcoin:master May 6, 2016
laanwj added a commit that referenced this pull request May 6, 2016
99e7075 Break circular dependency main ↔ txdb (Wladimir J. van der Laan)
codablock pushed a commit to codablock/dash that referenced this pull request Oct 19, 2017
99e7075 Break circular dependency main ↔ txdb (Wladimir J. van der Laan)
zkbot added a commit to zcash/zcash that referenced this pull request Mar 10, 2018
Bitcoin Core refactoring and cleanups 1

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#5994
- bitcoin/bitcoin#6538
- bitcoin/bitcoin#6163
- bitcoin/bitcoin#6982
- bitcoin/bitcoin#6986
- bitcoin/bitcoin#7053
- bitcoin/bitcoin#7444
- bitcoin/bitcoin#7793
  - Excluding some comments in `txmempool.h` on code we haven't yet pulled in.
- bitcoin/bitcoin#7916
- bitcoin/bitcoin#7815

Additionally, the Equihash parameters are moved into the consensus parameters.

Part of #2074.
zkbot added a commit to zcash/zcash that referenced this pull request Apr 6, 2018
Bitcoin Core refactoring and cleanups 1

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#5994
- bitcoin/bitcoin#6538
- bitcoin/bitcoin#6163
- bitcoin/bitcoin#6982
- bitcoin/bitcoin#6986
- bitcoin/bitcoin#7053
- bitcoin/bitcoin#7444
- bitcoin/bitcoin#7793
  - Excluding some comments in `txmempool.h` on code we haven't yet pulled in.
- bitcoin/bitcoin#7916
- bitcoin/bitcoin#7815

Additionally, the Equihash parameters are moved into the consensus parameters.

Part of #2074.
zkbot added a commit to zcash/zcash that referenced this pull request May 31, 2018
Bitcoin Core refactoring and cleanups 1

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#5994
- bitcoin/bitcoin#6538
- bitcoin/bitcoin#6163
- bitcoin/bitcoin#6982
- bitcoin/bitcoin#6986
- bitcoin/bitcoin#7053
- bitcoin/bitcoin#7444
- bitcoin/bitcoin#7793
  - Excluding some comments in `txmempool.h` on code we haven't yet pulled in.
- bitcoin/bitcoin#7916
- bitcoin/bitcoin#7815

Additionally, the Equihash parameters are moved into the consensus parameters.

Part of #2074.
zkbot added a commit to zcash/zcash that referenced this pull request Oct 24, 2018
Bitcoin Core refactoring and cleanups 1

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#5994
- bitcoin/bitcoin#6538
- bitcoin/bitcoin#6163
- bitcoin/bitcoin#6982
- bitcoin/bitcoin#6986
- bitcoin/bitcoin#7053
- bitcoin/bitcoin#7444
- bitcoin/bitcoin#7793
  - Excluding some comments in `txmempool.h` on code we haven't yet pulled in.
- bitcoin/bitcoin#7916
- bitcoin/bitcoin#7815

Additionally, the Equihash parameters are moved into the consensus parameters.

Part of #2074.
zkbot added a commit to zcash/zcash that referenced this pull request Oct 25, 2018
Bitcoin Core refactoring and cleanups 1

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#5994
- bitcoin/bitcoin#6538
- bitcoin/bitcoin#6163
- bitcoin/bitcoin#6982
- bitcoin/bitcoin#6986
- bitcoin/bitcoin#7053
- bitcoin/bitcoin#7444
- bitcoin/bitcoin#7793
  - Excluding some comments in `txmempool.h` on code we haven't yet pulled in.
- bitcoin/bitcoin#7916
- bitcoin/bitcoin#7815

Additionally, the Equihash parameters are moved into the consensus parameters.

Part of #2074.
zkbot added a commit to zcash/zcash that referenced this pull request Apr 5, 2019
Bitcoin Core refactoring and cleanups 1

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#6538
- bitcoin/bitcoin#6163
- bitcoin/bitcoin#6982
- bitcoin/bitcoin#6986
- bitcoin/bitcoin#7053
- bitcoin/bitcoin#7444
- bitcoin/bitcoin#7793
  - Excluding some comments in `txmempool.h` on code we haven't yet pulled in.
- bitcoin/bitcoin#7916
- bitcoin/bitcoin#7815

Additionally, the Equihash parameters are moved into the consensus parameters, and
various other functions in `main.cpp` have `const CChainParams&` arguments added.

Part of #2074.
zkbot added a commit to zcash/zcash that referenced this pull request Apr 9, 2019
Bitcoin Core refactoring and cleanups 1

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#6538
- bitcoin/bitcoin#6163
- bitcoin/bitcoin#6982
- bitcoin/bitcoin#6986
- bitcoin/bitcoin#7053
- bitcoin/bitcoin#7444
- bitcoin/bitcoin#7793
  - Excluding some comments in `txmempool.h` on code we haven't yet pulled in.
- bitcoin/bitcoin#7916
- bitcoin/bitcoin#7815

Additionally, the Equihash parameters are moved into the consensus parameters, and
various other functions in `main.cpp` have `const CChainParams&` arguments added.

Part of #2074.
zkbot added a commit to zcash/zcash that referenced this pull request May 24, 2019
Bitcoin Core refactoring and cleanups 1

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#6538
- bitcoin/bitcoin#6163
- bitcoin/bitcoin#6982
- bitcoin/bitcoin#6986
- bitcoin/bitcoin#7053
- bitcoin/bitcoin#7444
- bitcoin/bitcoin#7793
  - Excluding some comments in `txmempool.h` on code we haven't yet pulled in.
- bitcoin/bitcoin#7916
- bitcoin/bitcoin#7815

Additionally, the Equihash parameters are moved into the consensus parameters, and
various other functions in `main.cpp` have `const CChainParams&` arguments added.

Part of #2074.
zkbot added a commit to zcash/zcash that referenced this pull request May 28, 2019
Bitcoin Core refactoring and cleanups 1

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#6538
- bitcoin/bitcoin#6163
- bitcoin/bitcoin#6982
- bitcoin/bitcoin#6986
- bitcoin/bitcoin#7053
- bitcoin/bitcoin#7444
- bitcoin/bitcoin#7793
  - Excluding some comments in `txmempool.h` on code we haven't yet pulled in.
- bitcoin/bitcoin#7916
- bitcoin/bitcoin#7815

Additionally, the Equihash parameters are moved into the consensus parameters, and
various other functions in `main.cpp` have `const CChainParams&` arguments added.

Part of #2074.
random-zebra added a commit to PIVX-Project/PIVX that referenced this pull request Aug 12, 2020
5147571 Break circular dependency main ↔ txdb (random-zebra)
2725fac txdb: Add Cursor() method to CCoinsView to iterate over UTXO set (random-zebra)

Pull request description:

  Other two quick backports needed for the upcoming per-txout model.

  - bitcoin#7756 - Add cursor to iterate over utxo set, use this in `gettxoutsetinfo`
    > - Add a method `Cursor()` to `CCoinsView` that returns a cursor which can be used to iterate over the whole UTXO set.
    > - Implement `GetUTXOStats` in terms of this, remove `GetStats()` method on `CCoinsView`.
    > - Change `gettxoutsetinfo` RPC to use new `GetUTXOStats` function.

  - bitcoin#7815 - Break circular dependency main ↔ txdb (part of this was done already in #1302 and #1319)
    > - Moving `CBlockFileInfo` from main.h to chain.h. I think this makes sense, as the other block-file stuff is there too.
    > - Moving `CDiskTxPos` from main.h to txdb.h. This type, used for `-txindex` seems specific to txdb.
    > - Pass a functor `insertBlockIndex` to `LoadBlockIndexGuts`. This leaves it up to the caller how to insert block indices.

ACKs for top commit:
  furszy:
    ACK 5147571
  Fuzzbawls:
    ACK 5147571

Tree-SHA512: 166f5d797fac68667c59e002a3596af65596cd6ebee5e8b4bee538e6f66ec5f6365e4dd0bbb44be2226ebb51411d4db01f9f2417660841ed7a5125b3c8a7ad97
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants