Skip to content

Conversation

jtimon
Copy link
Contributor

@jtimon jtimon commented Jan 13, 2015

I had some misunderstandings about what @luke-jr and I agreed and disagreed on #5071.
That's why I created #5180. The only disagreement is how you allow users to select Params().RequireStandard() independently of the chainparams selected (but we agree that should be possible, @petertodd does too #5521 (comment)). That little disagreement is out of scope for this PR. The two potential solutions should be easier to review, maintain and discuss after this PR has been acked.
I thought he also disagreed on:

  1. Only the interface can be accessed from outside policy.cpp, the implementation is hidden.
  2. policy.o shouldn't depend on main.h or contain any concurrency-related code.

He doesn't disagree, he was just doing some things faster and left others for later in his version of policy encapsulation (https://github.com/luke-jr/bitcoin/tree/nodepolicy2). There's a version rebased on top of this PR that satisfies 1 but not 2 in https://github.com/jtimon/bitcoin/tree/luke_policy2 [I'm afraid I've also introduced an error in the last 3 commits].
He thought I also disagreed on:

  1. static variables contained in policy.o should become parameters of the reference policy implementation (CStandardPolicy).

I don't: I was just leaving that for later.

This PR is mostly composed of code movements that I expect will be uncontroversial. 3 commits just move a single function and its associated globals if any. 2 of them are not purely moveonly because they change the function headers or move some functionality from one function to another, but are mostly code movements.
Finally, the last commit creates a CPolicy interface (abstract class) and a CStandardPolicy implementation; and it's open for method name bikesheding.
@luke-jr if you like this PR I'm closing #5595 and #5114.

jtimon and others added 16 commits January 20, 2015 20:48
…let.cpp

Methods moved:

CWallet::IsMine()
CWallet::GetDebit()
CWallet::GetCredit()
CWallet::GetChange()
CWalletTx::IsTrusted()
Decouple it from util.h [bool error(char*)] and BOOST_FOREACH
(and initialize minRelayTxFee in InitPolicyFromArgs())
…(CTxOut)

Decouples CTxOut from CFeeRate
Simplifies IsDust() interface encapsulating the access to global minRelayTxFee
…::ValidateTx(CTransaction, CValidationState)
@jtimon jtimon changed the title Policy: Create CPolicy interface and CStandardPolicy implementation Policy: Continue policy movements Jan 21, 2015
@jtimon
Copy link
Contributor Author

jtimon commented Jan 21, 2015

Closing for now, at least until some agreement is found in #5595.

@jtimon jtimon closed this Jan 21, 2015
@jtimon jtimon mentioned this pull request Jan 21, 2015
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants