Commit graph

10479 commits

Author SHA1 Message Date
practicalswift 860e912583 Use unique_ptr for pwalletMain (CWallet) 2017-11-09 16:52:44 +01:00
Wladimir J. van der Laan 99ec12666b
Merge #11074: Assert that CWallet::SyncMetaData finds oldest transaction.
6c4042a Assert that CWallet::SyncMetaData finds oldest transaction. (Eelis)

Pull request description:

  Without this assert, the Clang static analyzer warns about subsequent dereferencing of copyFrom, because it can't be sure that it's not nullptr. See #9573.

Tree-SHA512: 83cbcb32c52c94fcfefbc90ec7de2011dacd6bdb0da35adc401b8d8dda6a86de2fa0403e2158592268c2cf15eef4f3d887d98c90f1031d4735d5f4bf9dbc1d23
2017-11-09 15:20:18 +01:00
Wladimir J. van der Laan 77ba4bf960
Merge #10368: [wallet] Remove helper conversion operator from wallet
5a5e4e9 [wallet] Remove CTransaction&() helper conversion operator from wallet implementation. (Karl-Johan Alm)

Pull request description:

  The `CTransaction&()` operator in `CMerkleTx` makes conversion into `CTransaction`s transparent, but was marked as to-be-removed in favor of explicitly getting the `tx` ivar, presumably as the operator can lead to ambiguous behavior and makes the code harder to follow.

  This PR removes the operator and adapts callers. This includes some cases of `static_cast<CTransaction>(wtx)` → `*wtx.tx`, which is definitely an improvement.

Tree-SHA512: 95856fec7194d6a79615ea1c322abfcd6bcedf6ffd0cfa89bbdd332ce13035fa52dd4b828d20df673072dde1be64b79c513529a6f422dd5f0961ce722a32d56a
2017-11-09 14:23:13 +01:00
Wladimir J. van der Laan ef3758d1ef
Merge #10696: Remove redundant nullptr checks before deallocation
b109a1c Remove redundant nullptr checks before deallocation (practicalswift)

Pull request description:

  Rationale:
  * `delete ptr` is a no-op if `ptr` is `nullptr`

Tree-SHA512: c98ce769125c4912186a8403cc08a59cfba85b7141af645c709b4c4eb90dd9cbdd6ed8076d50099d1e4ec2bf75917d1af6844082ec42bbb4d94d229a710e051c
2017-11-09 13:38:48 +01:00
Wladimir J. van der Laan 0ecc6305f4
Merge #11594: Improve -disablewallet parameter interaction
7963335 Fix -disablewallet default value (João Barbosa)
b411c2a Improve -disablewallet parameter interaction (João Barbosa)

Pull request description:

  The first commit logs a message for each configured wallet if `-disablewallet` is set:
  ```
  bitcoind -printtoconsole -regtest -disablewallet -wallet=foo -wallet=bar
  ...
  WalletParameterInteraction: parameter interaction: -disablewallet -> ignoring -wallet=foo
  WalletParameterInteraction: parameter interaction: -disablewallet -> ignoring -wallet=bar
  ```
  It also moves up the `-disablewallet` check which avoids the unnecessary `-wallet` soft set.

  The second commit fixes the default value of `-disablewallet`, currently the value is correct, but it should use `DEFAULT_DISABLE_WALLET`.

  The third commit can be dropped or squashed, just took the opportunity to fix the coding style there.

Tree-SHA512: bec13d2b2be5adf4680c77212020ed27dd05f15c4c73542d2005d91108bf704e2df1707ed2bec696e584ecd40eff7a63e25201fd70400222aa5a8da6aed6afeb
2017-11-09 13:32:35 +01:00
Wladimir J. van der Laan 0dec4cc300
Merge #11221: Refactor: simpler read
9db9d62 Refactor: make the read function simpler (gnuser)

Pull request description:

Tree-SHA512: 5a80cc1b841488323d421e6a40b245d149cab1988247aed6cc7468dcc042d3df15b6711f25e40ff16e03ac21de36adbaa1d8da61ccdb94f97c8b70c24a5eedc5
2017-11-09 13:16:03 +01:00
practicalswift 7536b08c10 trivial: Fix typo – alreardy → already 2017-11-08 11:36:18 +01:00
Wladimir J. van der Laan 77546a3182
Merge #11289: Add wallet backup text to import* and add* RPCs
c098c58 Wrap dumpwallet warning and note scripts aren't dumped (MeshCollider)
a38bfbc Add wallet backup text to import*, add* and dumpwallet RPCs (MeshCollider)

Pull request description:

  Closes https://github.com/bitcoin/bitcoin/issues/11243

  Adds "Requires a new wallet backup" text to `addwitnessaddress`, `importprivkey`, `importmulti`, `importaddress`, `importpubkey`, and `addmultisigaddress`. Also adds a warning to `dumpwallet` that backing up the seed alone is not sufficient to back up non-HD addresses

Tree-SHA512: 76d7cdca54d5b458acf479154620322391b889922525fddd6153f4164cfee393ad743757400cb8f6b1b30f24947df68ea9043b4e509f7df77a8fa05dda370933
2017-11-08 10:29:11 +01:00
Wladimir J. van der Laan 5ef3b6967b
Merge #11524: [net] De-duplicate connection eviction logic
5ce7cb9 [net] De-duplicate connection eviction logic (Thomas Snider)

Pull request description:

  While reviewing the safeguards against deliberate node isolation on the network by malicious actors, I found a good de-duplication candidate.

  I think this form is much more legible (the type of `cutoffs` notwithstanding).  ReverseCompareNodeTimeConnected is not included in the list since the cutoff size is a function of the remaining number of nodes in the candidate eviction set.

Tree-SHA512: ed17999fa9250dcf8448329219324477117e4ecd2d41dedd72ad253e44630eef50b3232c420f1862ebbfb9b8c94efbba1a235b519e39ff5946865c7d69a75280
2017-11-08 08:46:50 +01:00
Wladimir J. van der Laan 5776582b7f
Merge #11562: bench: use std::chrono rather than gettimeofday
24a0bdd bench: prefer a steady clock if the resolution is no worse (Cory Fields)
c515d26 bench: switch to std::chrono for time measurements (Cory Fields)

Pull request description:

  gettimeofday has portability issues, see for example #11558.

  Regardless of large-scale clock refactors in the future, I think it's fine for bench to just use std::chrono itself.

  Note that this may slightly improve bench accuracy and changes the display from tiny floats to nanosecond counts instead.

Tree-SHA512: 122355456d01ec6cfcf6867991715cf3a95eabbf5a4f2adc26a059b50382ffb318b7639cdd575197fc4ee5be8b967c0404f1f920d6f5bd4ddd0bd63b5e5c5632
2017-11-08 08:33:07 +01:00
Thomas Snider 5ce7cb9518 [net] De-duplicate connection eviction logic 2017-11-07 15:33:15 -08:00
Cory Fields 24a0bddf4a bench: prefer a steady clock if the resolution is no worse 2017-11-07 17:17:34 -05:00
Cory Fields c515d266ec bench: switch to std::chrono for time measurements
std::chrono removes portability issues.

Rather than storing doubles, store the untouched time_points. Then
convert to nanoseconds for display. This allows for maximum precision, while
keeping results comparable between differing hardware/operating systems.

Also, display full nanosecond counts rather than sub-second floats.
2017-11-07 17:15:58 -05:00
MarcoFalke dd561667cb
Merge #11389: Support having SegWit always active in regtest (sipa, ajtowns, jnewbery)
d61845818 Have SegWit active by default (Pieter Wuille)
4bd89210a Unit tests for always-active versionbits. (Anthony Towns)
d07ee77ab Always-active versionbits support (Pieter Wuille)
18e071841 [consensus] Pin P2SH activation to block 173805 on mainnet (John Newbery)
526023aa7 Improve handling of BIP9Deployment limits (Anthony Towns)

Pull request description:

  Most tests shouldn't have to deal with the now-historical SegWit activation transition (and other deployments, but SegWit is certainly the hardest one to accomodate).

  This PR makes a versionbits starttime of -1 equal to "always active", and enables it by default for SegWit on regtest. Individual tests can override this by using the existing `-vbparams` option.

  A few unit tests and functional tests are adapted to indeed override vbparams, as they specifically test the transition.

  This is in preparation for wallet SegWit support, but I thought having earlier eyes on it would be useful.

Tree-SHA512: 3f07a7b41cf46476e6c7a5c43244e68c9f41d223482cedaa4c02a3a7b7cd0e90cbd06b84a1f3704620559636a2268f5767d4c52d09c1b354945737046f618fe5
2017-11-07 17:05:46 -05:00
MarcoFalke 6f01dcf638
Merge #11597: [trivial] Fix error messages in CFeeBumper
a02c5e459 [trivial] Fix error messages in CFeeBumper (Karl-Johan Alm)

Pull request description:

  …pool fee rate.

Tree-SHA512: c179853b2a19fdb767e46b29068f3e1ce6db75fda4356746472c93c5b51f0aa495a988c4da1e14762993d57229e525594a2e9d0e089f931c1c67fec7807bda54
2017-11-07 15:12:45 -05:00
João Barbosa 7963335d25 Fix -disablewallet default value 2017-11-07 19:13:38 +00:00
João Barbosa b411c2a12a Improve -disablewallet parameter interaction 2017-11-07 19:13:38 +00:00
Pieter Wuille ef8a634358
Merge #10866: Fix -Wthread-safety-analysis warnings. Compile with -Wthread-safety-analysis if available.
76ea17c79 Add mutex requirement for AddToCompactExtraTransactions(…) (practicalswift)
4616c825a Use -Wthread-safety-analysis if available (+ -Werror=thread-safety-analysis if --enable-werror) (practicalswift)
7e319d639 Fix -Wthread-safety-analysis warnings. Change the sync.h primitives to std from boost. (Matt Corallo)

Pull request description:

  * Add mutex requirement for `AddToCompactExtraTransactions(…)`.
  * Use `-Wthread-safety-analysis` if available.
  * Rebased on top of https://github.com/TheBlueMatt/bitcoin/commits/2017-08-test-10923 - now includes: Fix -Wthread-safety-analysis warnings. Change the sync.h primitives to std from boost.

Tree-SHA512: fb7365f85daa2741c276a1c899228181a8d46af51db7fbbdffceeaff121a3eb2ab74d7c8bf5e7de879bcc5042d00d24cb4649c312d51caba45a3f6135fd8b38f
2017-11-07 10:36:58 -08:00
MarcoFalke 998c3046fa
Merge #11626: rpc: Make logging RPC public
cabff7588 rpc: Make logging RPC public (Wladimir J. van der Laan)

Pull request description:

  This started out as a developer hack but now it's useful enough for general use. Unhide the call by moving it to `control` category. This makes it documented in `help`.

Tree-SHA512: f45fa378558b552d4e2a110bf85100b0eaaa6180bb5f62cb54a251f66026d4625b670c69d85c281eebbf4b56b80b65618c51a5a593b8f9d0a04b31e95adc91f4
2017-11-07 11:25:37 -05:00
MarcoFalke 89cc4f905e
Merge #11554: Sanity-check script sizes in bitcoin-tx
a6f33ea77 Sanity-check script sizes in bitcoin-tx (Matt Corallo)

Pull request description:

Tree-SHA512: bb8ecb628763af23816ab085758f6140920a6ff05dcb298129c2bbe584a02a759c700a05740eca77023292c98a5658b2a608fa27d5a948d183f87ed9ab827952
2017-11-07 11:19:52 -05:00
MarcoFalke 87d90efd69
Merge #11618: rpc: Lock cs_main in blockToJSON/blockheaderToJSON
a9b6ba0b7 Add missing cs_main locks when calling blockToJSON/blockheaderToJSON (practicalswift)

Pull request description:

  `blockToJSON(...)` and `blockheaderToJSON(...)` read the variable `chainActive` which requires holding the mutex `cs_main`. So does `GetDifficulty(...)`.

Tree-SHA512: bfb94f5e3238accbf6a4daddde49d53f1891c38ae9b07e25b3098c485747159258f64bb66a50e147b32beac601de89d9d04ff717b6c4f1460d329c90a53d3333
2017-11-07 10:40:59 -05:00
MarcoFalke 5aeaa9ccd1
Merge #11585: addrman: Add missing lock in Clear() (CAddrMan)
3ab545d7f addrman: Add missing lock in Clear() (CAddrMan) (practicalswift)

Pull request description:

  Add missing lock in `Clear()` (`CAddrMan`).

  The variable `vRandom` is guarded by the mutex `cs`.

  **Note to reviewers:** Does this look correct? Should the lock cover the entire scope of the method, or should it be limited to cover only `std::vector<int>().swap(vRandom);`?

Tree-SHA512: 8833f31beaed1728fa55b13ddf9e0b8e24e395931497329be2440ce1c5113ff02871707d40830260adabd30c4ea86088f5da5cf8a821150c0d820f50a2ce386a
2017-11-07 10:35:12 -05:00
Wladimir J. van der Laan ffc0b11503
Merge #11480: [ui] Add toggle for unblinding password fields
ff35de8 [ui] Add toggle for unblinding password fields (Thomas Snider)

Pull request description:

  Proposed change for adding the ability to toggle password visibility in the password dialog.  This is similar to functionality in most password managers and is specifically added with the use case of password managers in mind - the password in that case is likely pasted twice into both the new password and confirm password fields.

  If this is a welcome change, I am open to suggestions on rearranging the layout.

Tree-SHA512: 1823f356f8f941cc584c44de264433e9a573cb8a358efa300a412c4458b5564d8d193969be40859195cf9c8d6768eee895ee22440d51db4f09175f9b4e28bced
2017-11-07 08:26:45 +01:00
Wladimir J. van der Laan cabff75880 rpc: Make logging RPC public
This started out as a developer hack but now it's useful
enough for general use. Unhide the call by moving it to `control` category.
This makes it documented in `help`.
2017-11-07 07:50:49 +01:00
practicalswift a9b6ba0b7c Add missing cs_main locks when calling blockToJSON/blockheaderToJSON 2017-11-07 07:17:47 +01:00
Pieter Wuille d618458184 Have SegWit active by default 2017-11-06 19:29:20 -08:00
Anthony Towns 4bd89210a1 Unit tests for always-active versionbits. 2017-11-06 19:23:40 -08:00
Pieter Wuille d07ee77ab9 Always-active versionbits support 2017-11-06 19:19:10 -08:00
John Newbery 18e071841e [consensus] Pin P2SH activation to block 173805 on mainnet 2017-11-06 19:09:12 -08:00
Anthony Towns 526023aa7a Improve handling of BIP9Deployment limits
Small tweaks by Pieter Wuille.
2017-11-06 19:09:05 -08:00
practicalswift 76ea17c796 Add mutex requirement for AddToCompactExtraTransactions(…)
The vector `vExtraTxnForCompact`, which is guarded by the mutex
`cs_main`, is accessed in `AddToCompactExtraTransactions(…)`.
2017-11-06 17:41:02 +01:00
Matt Corallo 7e319d6393 Fix -Wthread-safety-analysis warnings. Change the sync.h primitives to std from boost.
Commit 1.

This code was written by @TheBlueMatt in the following branch:
* https://github.com/TheBlueMatt/bitcoin/commits/2017-08-test-10923

This commit message was written by me (@practicalswift) who also squashed
@TheBlueMatt's commits into one and tried to summarize the changes made.

Commit 2.

Remove boost include. Remove boost mentions in comments.
2017-11-06 17:41:02 +01:00
Karl-Johan Alm a02c5e459a
[trivial] Fix error messages in CFeeBumper 2017-11-03 15:37:54 -07:00
Wladimir J. van der Laan 2f959a5874
Merge #11560: Connect to a new outbound peer if our tip is stale
6262915 Add unit test for stale tip checking (Suhas Daftuar)
83df257 Add CConnmanTest to mutate g_connman in tests (João Barbosa)
ac7b37c Connect to an extra outbound peer if our tip is stale (Suhas Daftuar)
db32a65 Track tip update time and last new block announcement from each peer (Suhas Daftuar)
2d4327d net: Allow connecting to extra outbound peers (Suhas Daftuar)

Pull request description:

  This is an alternative approach to #11534.  Rather than disconnect an outbound peer when our tip looks stale, instead try to connect to an additional outbound peer.

  Periodically, check to see if we have more outbound peers than we target (ie if any extra peers are in use), and if so, disconnect the one that least recently announced a new block (breaking ties by choosing the newest peer that we connected to).

Tree-SHA512: 8f19e910e0bb36867f81783e020af225f356451899adfc7ade1895d6d3bd5afe51c83759610dfd10c62090c4fe404efa0283b2f63fde0bd7da898a1aaa7fb281
2017-11-02 20:13:24 +01:00
Wladimir J. van der Laan 7008b07005
Merge #11593: rpc: work-around an upstream libevent bug
97932cd rpc: further constrain the libevent workaround (Cory Fields)
6b58360 rpc: work-around an upstream libevent bug (Cory Fields)

Pull request description:

  A rare race condition may trigger while awaiting the body of a message.

  This may fix some reported rpc hangs/crashes.

  This work-around mimics what libevent does internally once a write has started, which is what usually happens, but not always due to the processing happening on a different thread: e7ff4ef2b4/http.c (L373)

  Fixed upstream at: 5ff8eb2637

Tree-SHA512: b9fa97cae9da2a44101c5faf1e3be0b9cbdf722982d35541cf224be31430779c75e519c8ed18d06ab7487bfb1211069b28f22739f126d6c28ca62d3f73b79a52
2017-11-02 20:11:08 +01:00
Cory Fields 97932cd268 rpc: further constrain the libevent workaround
The bug was introduced in 2.1.6-beta, versions before that don't need the
workaround.
2017-11-02 14:37:35 -04:00
MarcoFalke bfb270acfa
Merge #11590: [Wallet] always show help-line of wallet encryption calls
720d9e8fa [Wallet] always show help-line of wallet encryption calls (Jonas Schnelli)

Pull request description:

  We do currently show/hide the wallet encryption RPC calls from the help if the current wallet.
  In case of an encrypted wallet, `encryptwallet` is hidden and `walletpassphrasechange`, `walletpassphrasechange` and `walletlock` do appear in the help.

  This is no longer ideal in case of multiwallet due to the fact that one may want help infos in order to target a specific wallet.

  IMO its preferable to have a static help screen (show everything always). The currently show/hidden calls do handle the possible invalid encryption-state fine.

  Fixes #11588

Tree-SHA512: 513fecd15248a31361f5143685e8cdeb63dfd3fa7120828917e1db54d936dc3db60d48ce46efa5c3a563a48157fe962689879856eeeed53f904686b12aec204e
2017-11-02 12:58:56 -04:00
Suhas Daftuar 626291508c Add unit test for stale tip checking 2017-11-02 12:39:14 -04:00
João Barbosa 83df25736e Add CConnmanTest to mutate g_connman in tests 2017-11-02 12:39:14 -04:00
Suhas Daftuar ac7b37cd2b Connect to an extra outbound peer if our tip is stale
If our tip hasn't updated in a while, that may be because our peers are
not relaying blocks to us that we would consider valid. Allow connection
to an additional outbound peer in that circumstance.

Also, periodically check to see if we are exceeding our target number of
outbound peers, and disconnect the one which has least recently
announced a new block to us (choosing the newest such peer in the case
of tie).
2017-11-02 12:39:14 -04:00
Cory Fields 6b58360f9b rpc: work-around an upstream libevent bug
A rare race condition may trigger while awaiting the body of a message, see
upsteam commit 5ff8eb26371c4dc56f384b2de35bea2d87814779 for details.

This may fix some reported rpc hangs/crashes.
2017-11-01 17:49:07 -04:00
Suhas Daftuar db32a65897 Track tip update time and last new block announcement from each peer 2017-11-01 13:13:45 -04:00
Suhas Daftuar 2d4327db19 net: Allow connecting to extra outbound peers 2017-11-01 13:13:43 -04:00
MarcoFalke 1b8c88451b
Merge #11376: Ensure backupwallet fails when attempting to backup to source file
5d465e396 Ensure backupwallet fails when attempting to backup to source file (Tomas van der Wansem)

Pull request description:

  Previous behaviour was to destroy the wallet (to zero-length)

  This fixes #11375

Tree-SHA512: bfd1738659b15e3f23b6bbdf55ec12269c62c820bf701daec19500b52bd5845bb5516733c6f76f36197eb155182a8a35dc239ad4de2ef1e59bbb0f124a455759
2017-11-01 12:27:02 -04:00
Wladimir J. van der Laan cffa5ee132
Merge #11531: Check that new headers are not a descendant of an invalid block (more effeciently)
f3d4adf Make p2p-acceptablock not an extended test (Matt Corallo)
00dcda6 [qa] test that invalid blocks on an invalid chain get a disconnect (Matt Corallo)
015a525 Reject headers building on invalid chains by tracking invalidity (Matt Corallo)
932f118 Accept unrequested blocks with work equal to our tip (Matt Corallo)
3d9c70c Stop always storing blocks from whitelisted peers (Matt Corallo)
3b4ac43 Rewrite p2p-acceptblock in preparation for slight behavior changes (Matt Corallo)

Pull request description:

  @sdaftuar pointed out that the version in #11487 was somewhat DoS-able as someone could feed you a valid chain that forked off the the last checkpoint block and force you to do lots of work just walking backwards across blocks for each new block they gave you. We came up with a few proposals but settled on the one implemented here as likely the simplest without obvious DoS issues. It uses our existing on-load mapBlockIndex walk to make sure everything that descends from an invalid block is marked as such, and then simply caches blocks which we attempted to connect but which were found to be invalid. To avoid DoS issues during IBD, this will need to depend on #11458.

  Includes tests from #11487.

Tree-SHA512: 46aff8332908e122dae72ceb5fe8cd241902c2281a87f58a5fb486bf69d46458d84a096fdcb5f3e8e07fbcf7466232b10c429f4d67855425f11b38ac0bf612e1
2017-11-01 14:42:08 +01:00
Wladimir J. van der Laan db2f83ed46
Merge #11511: [Init] Remove redundant exit(EXIT_FAILURE) instances and replace with return false
b296bf1 Init: Remove redundant exit(EXIT_FAILURE) instances and replace with return false (donaloconnor)

Pull request description:

  While reviewing the bitcoin code I noticed that there are a few exit(EXIT_FAILURE) at various places in the AppInit function.

  This function returns to main() which will return/exit with EXIT_FAILURE so returning false instead of an explicit exit(EXIT_FAILURE) seems to be cleaner.

  This PR attempts to make things a bit more consistent.

  There is a subtle difference between exit() and return from main in that the exit() will not clean up any local vars but I don't think this makes a difference in this case. Using exit() might even lead to bugs in the future where the dtor of local objects are expected to be called.

Tree-SHA512: 7d104c3a752b4e7d7bc2382ef7e62543462988f1bbf13dd4077fbeff5399729b76c71a4352556f188b8d306604232477466f5bb827b58a6f3f6273f2370e1faa
2017-11-01 14:26:23 +01:00
Wladimir J. van der Laan e1f6a2a801
Merge #11565: Make listsinceblock refuse unknown block hash
659b206 Make listsinceblock refuse unknown block hash (Russell Yanofsky)

Pull request description:

  Change suggested by @theuni  who noticed listsinceblock would ignore invalid block hashes causing it to return a completely unfiltered list of transactions.

Tree-SHA512: 3c8fb160265780d1334e856e853ab48e2e18372b8f1fc71ae480c3f45317048cc1fee0055d5c58031981a91b9c2bdbeb8e49a889d04ecba61729ce8109f2ce3f
2017-11-01 14:12:54 +01:00
Wladimir J. van der Laan 2631d55f61
Merge #11573: [Util] Update tinyformat.h
60b98f8 [Util] Update tinyformat.h (fanquake)

Pull request description:

  Updates `tinyformat.h` to commit c42f/tinyformat@689695c upstream. Including:
  8a2812d848
  5d9e05a347
  48e2e48789

  @achow101 mentioned that since upgrading to Ubuntu 17.10 (GCC 7), tinyformat had been throwing lots of -Wimplicit-fallthrough warnings. However fallthrough warnings should have been silenced by #10489. cc @theuni.

  The upstream commit to fix fallthrough warnings is in this PR https://github.com/c42f/tinyformat/pull/39.

  The last time tinyformat.h was updated in this repo was in #8274.

Tree-SHA512: a51bd30544693550e08148daf5d244e3a3a410caff7897351eb9cd28f661dc85e193e045bb86068ee4006b2f89a7233b7573b8c50d93d2a9a15a11386fdcc605
2017-11-01 14:12:13 +01:00
Jonas Schnelli 720d9e8fa1
[Wallet] always show help-line of wallet encryption calls 2017-10-31 20:22:41 -10:00
Matt Corallo 015a5258ad Reject headers building on invalid chains by tracking invalidity
This tracks the set of all known invalid-themselves blocks (ie
blocks which we attempted to connect but which were found to be
invalid). This is used to cheaply check if new headers build on an
invalid chain.

While we're at it we also resolve an edge-case in invalidateblock
on pruned nodes which results in them needing a reindex if they
fail to reorg.
2017-10-31 13:51:30 -04:00