kernel: add btck_block_tree_entry_equals

BlockTreeEntry objects are often compared. By exposing an equality
function, clients don't have to implement more expensive
comparisons based on height and block hash.
This commit is contained in:
stickies-v
2025-11-11 15:09:56 +00:00
parent 1c3d5c8ffd
commit 096924d39d
4 changed files with 63 additions and 0 deletions

View File

@@ -786,6 +786,11 @@ public:
{
}
bool operator==(const BlockTreeEntry& other) const
{
return btck_block_tree_entry_equals(get(), other.get()) != 0;
}
std::optional<BlockTreeEntry> GetPrevious() const
{
auto entry{btck_block_tree_entry_get_previous(get())};