File tree Expand file tree Collapse file tree 2 files changed +26
-30
lines changed Expand file tree Collapse file tree 2 files changed +26
-30
lines changed Original file line number Diff line number Diff line change @@ -189,36 +189,6 @@ int AbstractThresholdConditionChecker::GetStateSinceHeightFor(const CBlockIndex*
189
189
return pindexPrev->nHeight + 1 ;
190
190
}
191
191
192
- namespace
193
- {
194
- /* *
195
- * Class to implement versionbits logic.
196
- */
197
- class VersionBitsConditionChecker : public AbstractThresholdConditionChecker {
198
- private:
199
- const Consensus::BIP9Deployment& dep;
200
-
201
- protected:
202
- int64_t BeginTime () const override { return dep.nStartTime ; }
203
- int64_t EndTime () const override { return dep.nTimeout ; }
204
- int MinActivationHeight () const override { return dep.min_activation_height ; }
205
- int Period () const override { return dep.period ; }
206
- int Threshold () const override { return dep.threshold ; }
207
-
208
- bool Condition (const CBlockIndex* pindex) const override
209
- {
210
- return (((pindex->nVersion & VERSIONBITS_TOP_MASK) == VERSIONBITS_TOP_BITS) && (pindex->nVersion & Mask ()) != 0 );
211
- }
212
-
213
- public:
214
- explicit VersionBitsConditionChecker (const Consensus::BIP9Deployment& dep) : dep{dep} {}
215
- explicit VersionBitsConditionChecker (const Consensus::Params& params, Consensus::DeploymentPos id) : VersionBitsConditionChecker{params.vDeployments [id]} {}
216
-
217
- uint32_t Mask () const { return (uint32_t {1 }) << dep.bit ; }
218
- };
219
-
220
- } // namespace
221
-
222
192
BIP9Info VersionBitsCache::Info (const CBlockIndex& block_index, const Consensus::Params& params, Consensus::DeploymentPos id)
223
193
{
224
194
BIP9Info result;
Original file line number Diff line number Diff line change @@ -49,4 +49,30 @@ class AbstractThresholdConditionChecker {
49
49
int GetStateSinceHeightFor (const CBlockIndex* pindexPrev, ThresholdConditionCache& cache) const ;
50
50
};
51
51
52
+ /* *
53
+ * Class to implement versionbits logic.
54
+ */
55
+ class VersionBitsConditionChecker : public AbstractThresholdConditionChecker {
56
+ private:
57
+ const Consensus::BIP9Deployment& dep;
58
+
59
+ protected:
60
+ int64_t BeginTime () const override { return dep.nStartTime ; }
61
+ int64_t EndTime () const override { return dep.nTimeout ; }
62
+ int MinActivationHeight () const override { return dep.min_activation_height ; }
63
+ int Period () const override { return dep.period ; }
64
+ int Threshold () const override { return dep.threshold ; }
65
+
66
+ bool Condition (const CBlockIndex* pindex) const override
67
+ {
68
+ return (((pindex->nVersion & VERSIONBITS_TOP_MASK) == VERSIONBITS_TOP_BITS) && (pindex->nVersion & Mask ()) != 0 );
69
+ }
70
+
71
+ public:
72
+ explicit VersionBitsConditionChecker (const Consensus::BIP9Deployment& dep) : dep{dep} {}
73
+ explicit VersionBitsConditionChecker (const Consensus::Params& params, Consensus::DeploymentPos id) : VersionBitsConditionChecker{params.vDeployments [id]} {}
74
+
75
+ uint32_t Mask () const { return (uint32_t {1 }) << dep.bit ; }
76
+ };
77
+
52
78
#endif // BITCOIN_VERSIONBITS_IMPL_H
You can’t perform that action at this time.
0 commit comments