Page MenuHomePhabricator

refactoring: add a method for determining if a block is pruned or not
ClosedPublic

Authored by majcosta on Dec 3 2019, 20:55.

Details

Reviewers
deadalnix
nakihito
jasonbcox
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Restricted Project
Commits
rABCa8257058a391: refactoring: add a method for determining if a block is pruned or not
Summary

"The check for whether a block is pruned or not is sufficiently obscure that it deserves a macro. It is also used in 2 places, with more coming, e.g. #10757 (turns out it was a move, not an addition)."

This is a backport from Core PR13259: https://github.com/bitcoin/bitcoin/pull/13259

Test Plan
ninja check
./test/functional/test_runner.py

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

majcosta created this revision.Dec 3 2019, 20:55
Owners added a reviewer: Restricted Owners Package.Dec 3 2019, 20:55
Herald added a reviewer: Restricted Project. · View Herald TranscriptDec 3 2019, 20:55
nakihito accepted this revision.Dec 3 2019, 20:59
jasonbcox requested changes to this revision.Dec 3 2019, 23:18
jasonbcox added a subscriber: jasonbcox.
jasonbcox added inline comments.
src/validation.h
745 ↗(On Diff #14599)

Is there a reason the function isn't inlined like in the original PR?

This revision now requires changes to proceed.Dec 3 2019, 23:18
majcosta added inline comments.Dec 4 2019, 02:04
src/validation.h
745 ↗(On Diff #14599)

I decided not to because that would require me to #include <chain.h> as well. I don't know whether that function is called often enough to justify that dependency, but we can definitely inline it if that's best.

deadalnix accepted this revision.Dec 4 2019, 02:25
deadalnix added inline comments.
src/validation.h
745 ↗(On Diff #14599)

That's actually fantastic that this dependency isn't there. Let's keep it that way. Good call.

jasonbcox accepted this revision.Dec 5 2019, 00:03

agreed, good call

This revision is now accepted and ready to land.Dec 5 2019, 00:03