Skip to content

Commit 0160386

Browse files
authored
Merge pull request #736 from evoskuil/master
Restore set_block_confirmable.
2 parents 0f74846 + d4bbce0 commit 0160386

File tree

4 files changed

+13
-25
lines changed

4 files changed

+13
-25
lines changed

include/bitcoin/node/chasers/chaser_confirm.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ class BCN_API chaser_confirm
8989

9090
// These are thread safe.
9191
network::asio::strand independent_strand_;
92-
bool prevout_;
9392
};
9493

9594
} // namespace node

src/chasers/chaser_confirm.cpp

+10-20
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,11 @@ using namespace std::placeholders;
3636

3737
BC_PUSH_WARNING(NO_THROW_IN_NOEXCEPT)
3838

39-
// Single higher priority thread strand (base class strand uses network pool).
40-
// Higher priority than validator ensures locality to validator reads.
39+
// Independent threadpool and strand (base class strand uses network pool).
4140
chaser_confirm::chaser_confirm(full_node& node) NOEXCEPT
4241
: chaser(node),
4342
threadpool_(one, node.config().node.priority_()),
44-
independent_strand_(threadpool_.service().get_executor()),
45-
prevout_(node.archive().prevout_enabled())
43+
independent_strand_(threadpool_.service().get_executor())
4644
{
4745
}
4846

@@ -195,13 +193,6 @@ void chaser_confirm::do_bump(height_t) NOEXCEPT
195193
}
196194
else if (ec == database::error::block_valid)
197195
{
198-
// Set before if not using prevout table.
199-
if (!prevout_ && !query.set_strong(link))
200-
{
201-
fault(error::confirm2);
202-
return;
203-
}
204-
205196
// Confirmation query.
206197
if ((ec = query.block_confirmable(link)))
207198
{
@@ -213,7 +204,7 @@ void chaser_confirm::do_bump(height_t) NOEXCEPT
213204
}
214205

215206
// Unset from set before if not using prevout table.
216-
if (!prevout_ && !query.set_unstrong(link))
207+
if (!query.set_unstrong(link))
217208
{
218209
fault(error::confirm3);
219210
return;
@@ -231,16 +222,15 @@ void chaser_confirm::do_bump(height_t) NOEXCEPT
231222
return;
232223
}
233224

234-
// This is not necessary and may overflow the table link. Faster to
235-
// never do it and redo a tiny number of blocks in case of reorg.
236-
////if (!query.set_block_confirmable(link))
237-
////{
238-
//// fault(error::confirm5);
239-
//// return;
240-
////}
225+
// Otherwise we will reconfirm entire chain on restart.
226+
if (!query.set_block_confirmable(link))
227+
{
228+
fault(error::confirm5);
229+
return;
230+
}
241231

242232
// Set after if using prevout table.
243-
if (prevout_ && !query.set_strong(link))
233+
if (!query.set_strong(link))
244234
{
245235
fault(error::confirm6);
246236
return;

src/chasers/chaser_validate.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ BC_PUSH_WARNING(NO_VALUE_OR_CONST_REF_SHARED_PTR)
3737
BC_PUSH_WARNING(SMART_PTR_NOT_NEEDED)
3838
BC_PUSH_WARNING(NO_THROW_IN_NOEXCEPT)
3939

40-
// Multiple higher priority thread strand (base class strand uses network pool).
41-
// Higher priority than downloader (net) ensures locality to downloader writes.
40+
// Independent threadpool and strand (base class strand uses network pool).
4241
chaser_validate::chaser_validate(full_node& node) NOEXCEPT
4342
: chaser(node),
4443
threadpool_(node.config().node.threads_(), node.config().node.priority_()),

src/parser.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ parser::parser(system::chain::selection context) NOEXCEPT
115115
// database (caches)
116116

117117
configured.database.prevout_buckets = 850'001;
118-
configured.database.prevout_size = 2'600'000'000;
118+
configured.database.prevout_size = 5'250'000'000;
119119
configured.database.prevout_rate = 5;
120120

121121
configured.database.validated_tx_buckets = 0;
@@ -817,7 +817,7 @@ options_metadata parser::load_settings() THROWS
817817
(
818818
"database.prevout_size",
819819
value<uint64_t>(&configured.database.prevout_size),
820-
"The minimum allocation of the prevout table body, defaults to '2600000000'."
820+
"The minimum allocation of the prevout table body, defaults to '5250000000'."
821821
)
822822
(
823823
"database.prevout_rate",

0 commit comments

Comments
 (0)