@@ -55,7 +55,11 @@ static Mutex cs_blockchange;
55
55
static std::condition_variable cond_blockchange;
56
56
static CUpdatedBlock latestblock GUARDED_BY (cs_blockchange);
57
57
58
- NodeContext& EnsureNodeContext (const std::any& context)
58
+ NodeContext& EnsureNodeContext (const std::any& ctx) {
59
+ return EnsureAnyNodeContext (ctx);
60
+ }
61
+
62
+ NodeContext& EnsureAnyNodeContext (const std::any& context)
59
63
{
60
64
auto node_context = util::AnyPtr<NodeContext>(context);
61
65
if (!node_context) {
@@ -64,6 +68,10 @@ NodeContext& EnsureNodeContext(const std::any& context)
64
68
return *node_context;
65
69
}
66
70
71
+ CTxMemPool& EnsureMemPool (const std::any& ctx) {
72
+ return EnsureAnyMemPool (ctx);
73
+ }
74
+
67
75
CTxMemPool& EnsureMemPool (const NodeContext& node)
68
76
{
69
77
if (!node.mempool ) {
@@ -72,11 +80,15 @@ CTxMemPool& EnsureMemPool(const NodeContext& node)
72
80
return *node.mempool ;
73
81
}
74
82
75
- CTxMemPool& EnsureMemPool (const std::any& context)
83
+ CTxMemPool& EnsureAnyMemPool (const std::any& context)
76
84
{
77
85
return EnsureMemPool (EnsureNodeContext (context));
78
86
}
79
87
88
+ ChainstateManager& EnsureChainman (const std::any& ctx) {
89
+ return EnsureAnyChainman (ctx);
90
+ }
91
+
80
92
ChainstateManager& EnsureChainman (const NodeContext& node)
81
93
{
82
94
if (!node.chainman ) {
@@ -86,11 +98,15 @@ ChainstateManager& EnsureChainman(const NodeContext& node)
86
98
return *node.chainman ;
87
99
}
88
100
89
- ChainstateManager& EnsureChainman (const std::any& context)
101
+ ChainstateManager& EnsureAnyChainman (const std::any& context)
90
102
{
91
103
return EnsureChainman (EnsureNodeContext (context));
92
104
}
93
105
106
+ CBlockPolicyEstimator& EnsureFeeEstimator (const std::any& ctx) {
107
+ return EnsureAnyFeeEstimator (ctx);
108
+ }
109
+
94
110
CBlockPolicyEstimator& EnsureFeeEstimator (const NodeContext& node)
95
111
{
96
112
if (!node.fee_estimator ) {
@@ -99,7 +115,7 @@ CBlockPolicyEstimator& EnsureFeeEstimator(const NodeContext& node)
99
115
return *node.fee_estimator ;
100
116
}
101
117
102
- CBlockPolicyEstimator& EnsureFeeEstimator (const std::any& context)
118
+ CBlockPolicyEstimator& EnsureAnyFeeEstimator (const std::any& context)
103
119
{
104
120
return EnsureFeeEstimator (EnsureNodeContext (context));
105
121
}
0 commit comments