File tree Expand file tree Collapse file tree 1 file changed +10
-12
lines changed Expand file tree Collapse file tree 1 file changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -169,28 +169,26 @@ code distributor::do_notify<messages::block>(
169
169
if (subscriber.empty ())
170
170
return error::success;
171
171
172
+ messages::block::cptr ptr{};
172
173
if constexpr (use_block_allocator)
173
174
{
174
175
const auto arena = memory_.get_arena ();
175
176
if (is_null (arena))
176
177
return error::operation_failed;
177
178
178
- const auto ptr = messages::block::deserialize (*arena, version, data);
179
- if (!ptr)
180
- return error::invalid_message;
181
-
182
- subscriber.notify (error::success, ptr);
183
- return error::success;
179
+ ptr = messages::block::deserialize (*arena, version, data);
184
180
}
185
181
else
186
182
{
187
- const auto ptr = messages::deserialize<messages::block>(data, version);
188
- if (!ptr)
189
- return error::invalid_message;
190
-
191
- // Subscribers are notified only with stop code or error::success.
192
- subscriber.notify (error::success, ptr);
183
+ ptr = messages::deserialize<messages::block>(data, version);
193
184
}
185
+
186
+ if (!ptr)
187
+ return error::invalid_message;
188
+
189
+ // Subscribers are notified only with stop code or error::success.
190
+ subscriber.notify (error::success, ptr);
191
+ return error::success;
194
192
}
195
193
196
194
BC_POP_WARNING ()
You can’t perform that action at this time.
0 commit comments