Skip to content

Commit 3fd97a7

Browse files
authored
Merge pull request #454 from evoskuil/master
Fix missing return.
2 parents 7a90b1f + 00e50c0 commit 3fd97a7

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

src/net/distributor.cpp

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -169,28 +169,26 @@ code distributor::do_notify<messages::block>(
169169
if (subscriber.empty())
170170
return error::success;
171171

172+
messages::block::cptr ptr{};
172173
if constexpr (use_block_allocator)
173174
{
174175
const auto arena = memory_.get_arena();
175176
if (is_null(arena))
176177
return error::operation_failed;
177178

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);
184180
}
185181
else
186182
{
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);
193184
}
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;
194192
}
195193

196194
BC_POP_WARNING()

0 commit comments

Comments
 (0)