Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/bitcoin/blockchain/interface/block_chain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@ class BCB_API block_chain
// ------------------------------------------------------------------------
// Not thread safe except as noted.

/// Set the crash lock scope (for use only with insert).
/// Set the flush lock scope (for use only with insert).
bool begin_writes();

/// Reset the crash lock scope (for use only with insert).
/// Reset the flush lock scope (for use only with insert).
bool end_writes();

/// Insert a block to the blockchain, height is checked for existence.
Expand Down
4 changes: 2 additions & 2 deletions include/bitcoin/blockchain/interface/fast_chain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ class BCB_API fast_chain
// Writers.
// ------------------------------------------------------------------------

/// Set the crash lock scope (for use only with insert).
/// Set the flush lock scope (for use only with insert).
virtual bool begin_writes() = 0;

/// Reset the crash lock scope (for use only with insert).
/// Reset the flush lock scope (for use only with insert).
virtual bool end_writes() = 0;

/// Insert a block to the blockchain, height is checked for existence.
Expand Down
6 changes: 3 additions & 3 deletions src/interface/block_chain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -910,16 +910,16 @@ bool block_chain::stopped() const
// Sequential locking helpers.
// ----------------------------------------------------------------------------

// Use to create crash lock scope around multiple closely-spaced inserts.
// Use to create flush lock scope around multiple closely-spaced inserts.
// This is a performance optimization that requires write_serial(..., false).
bool block_chain::begin_writes()
{
return database_.crash_lock();
return database_.flush_lock();
}

bool block_chain::end_writes()
{
return database_.crash_unlock();
return database_.flush_unlock();
}

// private
Expand Down
4 changes: 2 additions & 2 deletions src/pools/orphan_pool_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ bool orphan_pool_manager::start()
subscriber_->start();

///////////////////////////////////////////////////////////////////////////
// Begin crash lock.
// Begin flush lock.
return flush_ || fast_chain_.begin_writes();
}

Expand All @@ -81,7 +81,7 @@ bool orphan_pool_manager::stop()
subscriber_->invoke(error::service_stopped, 0, {}, {});

return flush_ || fast_chain_.end_writes();
// End crash lock.
// End flush lock.
///////////////////////////////////////////////////////////////////////////
}

Expand Down