HomePhabricator

[wallet] Remove redundant initialization

Description

[wallet] Remove redundant initialization

Summary:
Prior to this commit pindexRescan was initialized to a chainActive.Tip().
However, the value of pindexRescan set at time of initialization was never
read before pindexRescan was being set to either chainActive.Genesis()
(case 1), FindForkInGlobalIndex(chainActive, locator) (case 2) or
chainActive.Genesis() (case 3). Thus, the initialization was redundant.

This commit a.) removes the redundant initialization and b.) simplifies
this logic so that pindexRescan is initialized to chainActive.Genesis()
(case 1 and 3), and set to FindForkInGlobalIndex(chainActive, locator)
(case 2) as needed.

Backport core's PR9576

Test Plan:

make check
./test/functional/test_runner.py

Reviewers: #bitcoin_abc, matiu

Reviewed By: #bitcoin_abc, matiu

Subscribers: teamcity

Differential Revision: https://reviews.bitcoinabc.org/D1048

Details

Provenance
practicalswift <practicalswift@users.noreply.github.com>Authored on Jan 18 2017, 16:59
deadalnixCommitted on Jan 31 2018, 10:39
deadalnixPushed on Jan 31 2018, 10:39
Reviewer
Restricted Project
Differential Revision
D1048: [wallet] Remove redundant initialization
Parents
rABC025b432bc441: [ci] fix ordering of commands in teamcity build script
Branches
Unknown
Tags
Unknown

Event Timeline

deadalnix committed rABC3782402c08f4: [wallet] Remove redundant initialization (authored by practicalswift <practicalswift@users.noreply.github.com>).Jan 31 2018, 10:39