fix: Acquire lock on getClosedLedgerHash

This commit is contained in:
Timothy Banks
2026-07-16 17:41:34 +01:00
committed by Ayaz Salikhov
parent 846369cbe7
commit d60955e2fc
4 changed files with 5 additions and 4 deletions

View File

@@ -333,7 +333,7 @@ public:
setPublisherListSequence(PublicKey const&, std::size_t const) override
{
}
[[nodiscard]] uint256 const&
[[nodiscard]] uint256
getClosedLedgerHash() const override
{
static uint256 const kHash{};

View File

@@ -140,7 +140,7 @@ public:
setPublisherListSequence(PublicKey const&, std::size_t const) override
{
}
[[nodiscard]] uint256 const&
[[nodiscard]] uint256
getClosedLedgerHash() const override
{
static uint256 const kHash{};

View File

@@ -117,7 +117,7 @@ public:
// Ledger
//
[[nodiscard]] virtual uint256 const&
[[nodiscard]] virtual uint256
getClosedLedgerHash() const = 0;
[[nodiscard]] virtual bool
hasLedger(uint256 const& hash, std::uint32_t seq) const = 0;

View File

@@ -426,9 +426,10 @@ public:
// Ledger
//
uint256 const&
uint256
getClosedLedgerHash() const override
{
std::scoped_lock const sl{recentLock_};
return closedLedgerHash_;
}