dogecoin/contrib
fanquake 8625446b4d
Merge #17336: scripts: search for first block file for linearize-data with some block files pruned
317fb96de9 Add search for first blk file with pruned node (Rjected)

Pull request description:

  <!--
  *** Please remove the following help text before submitting: ***

  Pull requests without a rationale and clear improvement may be closed
  immediately.
  -->

  <!--
  Please provide clear motivation for your patch and explain how it improves
  Bitcoin Core user experience or Bitcoin Core developer experience
  significantly:

  * Any test improvements or new tests that improve coverage are always welcome.
  * All other changes should have accompanying unit tests (see `src/test/`) or
    functional tests (see `test/`). Contributors should note which tests cover
    modified code. If no tests exist for a region of modified code, new tests
    should accompany the change.
  * Bug fixes are most welcome when they come with steps to reproduce or an
    explanation of the potential issue as well as reasoning for the way the bug
    was fixed.
  * Features are welcome, but might be rejected due to design or scope issues.
    If a feature is based on a lot of dependencies, contributors should first
    consider building the system outside of Bitcoin Core, if possible.
  * Refactoring changes are only accepted if they are required for a feature or
    bug fix or otherwise improve developer experience significantly. For example,
    most "code style" refactoring changes require a thorough explanation why they
    are useful, what downsides they have and why they *significantly* improve
    developer experience or avoid serious programming bugs. Note that code style
    is often a subjective matter. Unless they are explicitly mentioned to be
    preferred in the [developer notes](/doc/developer-notes.md), stylistic code
    changes are usually rejected.
  -->
  When bitcoind is running in pruned mode, producing a hashlist with `./linearize-hashes.py linearize.cfg > hashlist.txt` and then executing `linearize-data.py linearize.cfg` will produce:
  ```
  Read 313001 hashes
  Input file /home/dan/.bitcoin/blocks/blk00000.dat
  Premature end of block data
  ```
  This happens because `linearize-data` starts by attempting to process `blk00000.dat` regardless of whether or not `blk00000.dat` actually exists - this may not be the case if working with a pruned node.
  This PR adds a function which finds the first block file that does exist, and calls that function when the `BlockDataCopier` is initialized.

  This is a refactor of #16431.

  <!--
  Bitcoin Core has a thorough review process and even the most trivial change
  needs to pass a lot of eyes and requires non-zero or even substantial time
  effort to review. There is a huge lack of active reviewers on the project, so
  patches often sit for a long time.
  -->

ACKs for top commit:
  darosior:
    ACK 317fb96de9
  laanwj:
    Code review ACK 317fb96de9
  theStack:
    Code review ACK 317fb96de9

Tree-SHA512: fc8014282df6cfe7b267e64db8ce7d82b86b758c302fbfea4a3c39b62d93512f5c2e31a0de4e9c5ec18fc0268c917f011257d37b45afaef6033eec90e4aa585f
2020-02-05 08:45:06 +08:00
..
debian doc: Update license year range to 2020 2019-12-26 23:11:21 +01:00
devtools test: rename test suite name "tx_validationcache_tests" to match filename 2020-01-27 22:44:02 +01:00
gitian-descriptors Merge #17863: scripts: Add MACHO dylib checks to symbol-check.py 2020-01-22 20:33:44 +01:00
gitian-keys Merge #17436: Add TheCharlatan's pgp key 2019-11-18 10:54:49 +01:00
guix guix: Update documentation for time-machine 2020-01-27 16:41:20 -05:00
init Merge #16569: Increase init file stop timeout 2019-10-08 11:38:44 +02:00
linearize Merge #17336: scripts: search for first block file for linearize-data with some block files pruned 2020-02-05 08:45:06 +08:00
macdeploy scripted-diff: Bump copyright of files changed in 2020 2020-01-15 02:18:00 +07:00
qos scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
seeds Merge #17823: scripts: Read suspicious hosts from a file instead of hardcoding 2020-01-20 20:24:38 +01:00
testgen doc: Fix whitespace errs in .md files, bitcoin.conf, Info.plist.in, and find_bdb48.m4 2019-09-17 03:21:22 -04:00
verify-commits scripted-diff: Bump copyright of files changed in 2020 2020-01-15 02:18:00 +07:00
verifybinaries scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
windeploy scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
zmq build: Require python 3.5 2019-03-02 10:40:23 -05:00
bitcoin-cli.bash-completion scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
bitcoin-qt.pro Add CreateWalletDialog to create wallets from the GUI 2019-09-05 20:36:57 -04:00
bitcoin-tx.bash-completion bash-completion: Adapt for 0.12 and 0.13 2016-07-07 07:52:59 -04:00
bitcoind.bash-completion scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
filter-lcov.py scripted-diff: Add missed copyright headers 2020-01-04 20:18:28 +02:00
gitian-build.py scripted-diff: Add missed copyright headers 2020-01-04 20:18:28 +02:00
install_db4.sh scripted-diff: Add missed copyright headers 2020-01-04 20:18:28 +02:00
README.md doc: Fix whitespace errs in .md files, bitcoin.conf, Info.plist.in, and find_bdb48.m4 2019-09-17 03:21:22 -04:00
valgrind.supp bump test timeouts so that functional tests run in valgrind 2020-01-25 15:51:35 +08:00

Repository Tools

Developer tools

Specific tools for developers working on this repository. Additional tools, including the github-merge.py script, are available in the maintainer-tools repository.

Verify-Commits

Tool to verify that every merge commit was signed by a developer using the github-merge.py script.

Linearize

Construct a linear, no-fork, best version of the blockchain.

Qos

A Linux bash script that will set up traffic control (tc) to limit the outgoing bandwidth for connections to the Bitcoin network. This means one can have an always-on bitcoind instance running, and another local bitcoind/bitcoin-qt instance which connects to this node and receives blocks from it.

Seeds

Utility to generate the pnSeed[] array that is compiled into the client.

Build Tools and Keys

Packaging

The Debian subfolder contains the copyright file.

All other packaging related files can be found in the bitcoin-core/packaging repository.

Gitian-descriptors

Files used during the gitian build process. For more information about gitian, see the the Bitcoin Core documentation repository.

Gitian-keys

PGP keys used for signing Bitcoin Core Gitian release results.

MacDeploy

Scripts and notes for Mac builds.

Gitian-build

Script for running full Gitian builds.

Test and Verify Tools

TestGen

Utilities to generate test vectors for the data-driven Bitcoin tests.

Verify Binaries

This script attempts to download and verify the signature file SHA256SUMS.asc from bitcoin.org.