-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Refactor: Create CCoinsViewEfficient interface for CCoinsViewCache #5747
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
As discussed on IRC. The first commit (making CCoinsView an interface class and creating CCoinsViewDummy to reimplement the current CCoinsView) is confusing, and really doesn't add any functionality. I'd prefer to skip that. |
|
I assume you're talking about HaveInputs(), GetValueIn(), GetPriority() and GetOutputFor() |
|
No, I just meant that the classes with virtual functions need virtual destructors. |
|
Nits resolved. |
|
I would prefer moving GetOutputFor, GetPriority, GetValueIn, and HaveInputs to become validation/policy related utiliy functions in main, avoiding the issue altogether. |
|
haveinputs is used in consensus (see jtimon@0ac0610). GetValueIn (which uses GetOutputFor) could be modified to avoid some code duplication with consensus. |
|
Ok, that can happen independently if it doesn't solve any controversy. I just don't think GetOutputFor, GetPriority, GetValueIn and HaveInputs belong in CCoins (despite me being the one who put them there). |
|
untested ACK, but verified b627d9abbe25a11ffca02ef1f3ab312575e5e450 as moveonly. |
|
utACK |
f27707c to
83b9ce3
Compare
|
Updated doing the includes better (not inclding coins.h nor coinscache.h from main.h), after doing that it needed rebase, so I rebased it. The non-includes code remains the same. |
…insViewCache (make parent its class)
|
Needed rebase. |
|
I'm having second thoughts about this, closing for now. |
To move AreInputsStandard() and its consensus homologous to policy.o and consensus.o respectively without making those modules dependent on CCoinsModifier nor CCoinsViewCache, we need an interface that doesn't implement the method
CCoins* AccessCoins(const uint256 &txid). This interface doesn't need several other methods from CCoinsViewCache.You can see some code using this change at #5697