Skip to content

Commit 334f44f

Browse files
committed
Fix thread safety of block out superseded flag, remove assert.
1 parent 09581eb commit 334f44f

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

include/bitcoin/node/protocols/protocol_block_out_70012.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ class BCN_API protocol_block_out_70012
5050
const network::messages::peer::send_headers::cptr& message) NOEXCEPT;
5151

5252
private:
53-
// This is protected by strand.
54-
bool superseded_{};
53+
// This is thread safe.
54+
std::atomic_bool superseded_{};
5555
};
5656

5757
} // namespace node

src/protocols/protocol_block_out_70012.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ bool protocol_block_out_70012::handle_receive_send_headers(const code& ec,
6565
// Suspends inventory announcement processing in favor of header announcements.
6666
bool protocol_block_out_70012::superseded() const NOEXCEPT
6767
{
68-
BC_ASSERT(stranded());
6968
return superseded_;
7069
}
7170

0 commit comments

Comments
 (0)