Page MenuHomePhabricator

[refactor] remove indirect constant reference in policy.h
AbandonedPublic

Authored by majcosta on May 25 2020, 21:41.

Details

Reviewers
deadalnix
Group Reviewers
Restricted Project
Summary

D4896 added the function GetVirtualTransactionSize that references
::nBytesPerSigOp, a global initialized by the constant
DEFAULT_BYTES_PER_SIGOP which is defined in policy.h

This was naively 'fixed' in D5967 by me including policy/settings.h in
policy.h which was wrong, and will be (is) a problem when backporting
PR15639, which includes policy/policy.h in policy/settings.h, creating
an include loop that the compiler does not like.

This diff corrects the issue by actually referencing DEFAULT_BYTES_PER_SIGOP
instead of doing it the roundabout way.

That let us remove #include <policy/settings.h> from policy/policy.h,
which revealed that wallet/wallet.cpp was depending on it being indirectly
included for dustRelayFee. So #include <policy/settings.h> is added
to wallet/wallet.cpp

Test Plan
ninja check-all

Event Timeline

[Bot Message]
One or more PR numbers were detected in the summary.
Links to those PRs have been inserted into the summary for reference.

deadalnix requested changes to this revision.May 25 2020, 23:23
deadalnix added a subscriber: deadalnix.
deadalnix added inline comments.
src/policy/policy.h
148

This completely changes the behavior.

This revision now requires changes to proceed.May 25 2020, 23:23

This is all wrong, abandoning