Page MenuHomePhabricator

Remove globals.h and the remaining block priority percentage global
AbandonedPublic

Authored by jasonbcox on Jun 28 2018, 21:31.

Details

Reviewers
deadalnix
schancel
Group Reviewers
Restricted Project
Summary

Cleanup another global variable. Depends on D1519.

Test Plan

make check && test_runner && test_runner --extended

Diff Detail

Repository
rABC Bitcoin ABC
Branch
globals2
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 2773
Build 3656: Bitcoin ABC Buildbot (legacy)
Build 3655: arc lint + arc unit

Event Timeline

deadalnix requested changes to this revision.Jun 30 2018, 15:06

Having global.h is a feature. e have a bunch of globals. If you can make them accessible through the GlobalConfig, and put them in global.h , then you find yourself is a situation where the globals cannot be used directly, which allows you to do what you just did in that diff. Nothing is gained by removing it.

In addition, it's kind of dangerous to remove the globals this way, as you experienced in D1519 , as the config can become inconsistent from one instance to the other - and code relying on GetConfig will just get it plain wrong. Moving globals in global.h/cpp and getting rid of GetConfig calls is a much safer path forward, as, once we have no calls to GetConfig anymore, we have a guarantee that all globals are accessed through the GlobalConfig and never directly and can there fore be unglobalized as no code can notice anymore.

Finally, the global you removed is literally used nowhere, so all the migration code is useless and should be deleted instead.

This revision now requires changes to proceed.Jun 30 2018, 15:06