Page MenuHomePhabricator

[Part1] Removed Params() from addrdb
ClosedPublic

Authored by matra774 on Feb 8 2018, 21:17.

Details

Summary

Replace direct calls of Params() with Config.GetChainParams() Refs T170

Test Plan

make check
./test/functional/test_runner.py --extended

Diff Detail

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

Event Timeline

Owners added a reviewer: Restricted Owners Package.Feb 8 2018, 21:17

Here is the first chunk of T170 – I replaced usages of Params() in addrdb.cpp and fixed all refrences.

Works that remains:

  • Fix the remaining code, that already holds the reference to Config (destnode.cpp, netprocessing.cpp, blochckain.cpp,…) Config.GetChainParams() can be used in this case.

Usages that are harder to fix:

  • base58.cpp uses Params().Base58Prefix. Constructors for bunch of classes (CBitcoinSecret, CBitcoinExtKey, CBitcoinExtPubKey) would need to be changed if we want to inject the configuration. Probably not worth it?
  • QT related code (bitcoin_gui.cpp has reference, but does not pass it to child QT object)
  • the are some global functions that use Params() we could pass the conifg all the way down the call stacks
  • should we fix CPP tests too?
jasonbcox added a subscriber: deadalnix.

Looks good to me, but make sure @deadalnix signs off too. I'm not sure if he's reviewed the ticket in the first place.

deadalnix requested changes to this revision.Feb 9 2018, 20:58

Please fix file authorizations.

src/addrdb.h
1 ↗(On Diff #2823)

Revert file mode.

This revision now requires changes to proceed.Feb 9 2018, 20:58
This revision is now accepted and ready to land.Feb 11 2018, 17:40
This revision was automatically updated to reflect the committed changes.