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
1 change: 1 addition & 0 deletions include/bitcoin/node/chasers/chaser_confirm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ class BCN_API chaser_confirm
// These are thread safe.
network::asio::strand independent_strand_;
const bool concurrent_;
bool prevout_;
};

} // namespace node
Expand Down
21 changes: 19 additions & 2 deletions src/chasers/chaser_confirm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ chaser_confirm::chaser_confirm(full_node& node) NOEXCEPT
: chaser(node),
threadpool_(one, node.config().node.priority_()),
independent_strand_(threadpool_.service().get_executor()),
concurrent_(node.config().node.concurrent_confirmation)
concurrent_(node.config().node.concurrent_confirmation),
prevout_(node.archive().prevout_enabled())
{
}

Expand Down Expand Up @@ -204,6 +205,13 @@ void chaser_confirm::do_bump(height_t) NOEXCEPT
}
else if (ec == database::error::block_valid)
{
// Set before if not using prevout table.
if (!prevout_ && !query.set_strong(link))
{
fault(error::confirm5);
return;
}

// Confirmation query.
if ((ec = query.block_confirmable(link)))
{
Expand All @@ -213,6 +221,13 @@ void chaser_confirm::do_bump(height_t) NOEXCEPT
return;
}

// Unset from set before if not using prevout table.
if (!prevout_ && !query.set_unstrong(link))
{
fault(error::confirm5);
return;
}

if (!query.set_block_unconfirmable(link))
{
fault(error::confirm3);
Expand All @@ -231,14 +246,16 @@ void chaser_confirm::do_bump(height_t) NOEXCEPT
return;
}

if (!query.set_strong(link))
// Set after if using prevout table.
if (prevout_ && !query.set_strong(link))
{
fault(error::confirm5);
return;
}
}
else if (ec == database::error::block_confirmable)
{
// Set in either case.
if (!query.set_strong(link))
{
fault(error::confirm6);
Expand Down
Loading