Page MenuHomePhabricator

Merge #15999: init: Remove dead code in LoadChainTip
ClosedPublic

Authored by nakihito on Jun 17 2020, 22:53.

Details

Reviewers
Fabien
deadalnix
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Restricted Project
Commits
rABC094184ba4325: Merge #15999: init: Remove dead code in LoadChainTip
Summary

fa86c8aec6 init: Remove dead code in LoadChainTip (MarcoFalke)

Pull request description:

`LoadChainTip` sets `::ChainActive()` based on `pcoinsTip`'s best block. `LoadChainTip` is never called when that block is null, so we can remove all code from within that method that is only executed when that block is null.

Fixes #15967  Inconsistent locking behavior in LoadChainTip

ACKs for commit fa86c8:

promag:
  utACK fa86c8aec611a9b9d2f53960c92419cf2a8bb92d.
practicalswift:
  utACK fa86c8aec611a9b9d2f53960c92419cf2a8bb92d
Empact:
  utACK https://github.com/bitcoin/bitcoin/pull/15999/commits/fa86c8aec611a9b9d2f53960c92419cf2a8bb92d
laanwj:
  utACK fa86c8aec611a9b9d2f53960c92419cf2a8bb92d
ryanofsky:
  utACK fa86c8aec611a9b9d2f53960c92419cf2a8bb92d. LoadChainTip isn't called currently when pcoinsTip best block is null due to this line:
jamesob:
  utACK https://github.com/bitcoin/bitcoin/pull/15999/commits/fa86c8aec611a9b9d2f53960c92419cf2a8bb92d

Tree-SHA512: 8961c0e579800a52038ac5655478468852faac055299b64d6cfdf0c213d3bf09669c4889467d09d93457f6c8b073967bb0475a137f77ddd3a3a3c03ad90001c4

Backport of Core PR15999

Our only call for LoadChainTip() is here and requires pcoinsTip to not be null.

Test Plan
ninja
ninja check-all

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Owners added a reviewer: Restricted Owners Package.Jun 17 2020, 22:53

[Bot Message]
One or more PR numbers were detected in the summary.
Links to those PRs have been inserted into the summary for reference.

nakihito edited the summary of this revision. (Show Details)

Updated summary.

Fabien added subscribers: deadalnix, Fabien.

@deadalnix I fail to remember if there was anything remaining that was waiting on this change, can you take a look ?

This revision is now accepted and ready to land.Jun 18 2020, 23:12