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

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
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Owners added a reviewer: Restricted Owners Package.Dec 3 2019, 20:55
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
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 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.

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