@@ -36,16 +36,16 @@ inline code CLASS::to_block_code(
3636{
3737 switch (value)
3838 {
39- // Block satisfies validation rules (prevouts unverified).
39+ // Transitional: Satisfies validation rules (prevouts unverified).
4040 case schema::block_state::valid:
4141 return error::block_valid;
42- // Final: Block satisfies confirmation rules (prevouts).
42+ // Final: Satisfies confirmation rules (prevouts confirmable ).
4343 case schema::block_state::confirmable:
4444 return error::block_confirmable;
45- // Final: Block does not satisfy validation/ confirmation rules.
45+ // Final: Does not satisfy either validation or confirmation rules.
4646 case schema::block_state::unconfirmable:
4747 return error::block_unconfirmable;
48- // Block has no recorded state, may be under checkpoint or milestone .
48+ // Fault: Has no state, should not happen when read from store .
4949 default :
5050 return error::unknown_state;
5151 }
@@ -61,16 +61,13 @@ inline code CLASS::to_tx_code(
6161 // All states below are relevant only to the associated validation context.
6262 switch (value)
6363 {
64- // Tx is valid in the case where standard prevouts are matched.
65- case schema::tx_state::preconnected:
66- return error::tx_preconnected;
67- // Final: Tx is valid (passed check, accept, and connect).
64+ // Final: Is valid (passed check, accept, and connect).
6865 case schema::tx_state::connected:
6966 return error::tx_connected;
70- // Final: Tx is not valid (failed check, accept, or connect).
67+ // Final: Is not valid (failed check, accept, or connect).
7168 case schema::tx_state::disconnected:
7269 return error::tx_disconnected;
73- // Tx has no recorded state, may be under checkpoint or milestone .
70+ // Fault: Has no state, should not happen when read from store .
7471 default :
7572 return error::unknown_state;
7673 }
@@ -307,25 +304,6 @@ bool CLASS::set_block_unconfirmable(const header_link& link) NOEXCEPT
307304 // ========================================================================
308305}
309306
310- TEMPLATE
311- bool CLASS::set_tx_preconnected (const tx_link& link,
312- const context& ctx) NOEXCEPT
313- {
314- // ========================================================================
315- const auto scope = store_.get_transactor ();
316-
317- // Clean single allocation failure (e.g. disk full).
318- return store_.validated_tx .put (link, table::validated_tx::slab
319- {
320- {},
321- ctx,
322- schema::tx_state::preconnected,
323- 0 , // fee
324- 0 // sigops
325- });
326- // ========================================================================
327- }
328-
329307TEMPLATE
330308bool CLASS::set_tx_disconnected (const tx_link& link,
331309 const context& ctx) NOEXCEPT
@@ -367,40 +345,40 @@ bool CLASS::set_tx_connected(const tx_link& link, const context& ctx,
367345 // ========================================================================
368346}
369347
370- TEMPLATE
371- bool CLASS::set_txs_connected (const header_link& link) NOEXCEPT
372- {
373- context ctx{};
374- if (!get_context (ctx, link))
375- return false ;
376-
377- const auto txs = to_transactions (link);
378- if (txs.empty ())
379- return false ;
380-
381- // FOR PERFORMANCE EVALUATION ONLY.
382- constexpr uint64_t fee = 99 ;
383- constexpr size_t sigops = 42 ;
384- using sigs = linkage<schema::sigops>;
385-
386- // ========================================================================
387- const auto scope = store_.get_transactor ();
388-
389- // Clean single allocation failure (e.g. disk full).
390- return std_all_of (bc::seq, txs.begin (), txs.end (),
391- [&](const tx_link& fk) NOEXCEPT
392- {
393- return store_.validated_tx .put (fk, table::validated_tx::slab
394- {
395- {},
396- ctx,
397- schema::tx_state::connected,
398- fee,
399- system::possible_narrow_cast<sigs::integer>(sigops)
400- });
401- });
402- // ========================================================================
403- }
348+ // // TEMPLATE
349+ // // bool CLASS::set_txs_connected(const header_link& link) NOEXCEPT
350+ // // {
351+ // // context ctx{};
352+ // // if (!get_context(ctx, link))
353+ // // return false;
354+ // //
355+ // // const auto txs = to_transactions(link);
356+ // // if (txs.empty())
357+ // // return false;
358+ // //
359+ // // // FOR PERFORMANCE EVALUATION ONLY.
360+ // // constexpr uint64_t fee = 99;
361+ // // constexpr size_t sigops = 42;
362+ // // using sigs = linkage<schema::sigops>;
363+ // //
364+ // // // ========================================================================
365+ // // const auto scope = store_.get_transactor();
366+ // //
367+ // // // Clean single allocation failure (e.g. disk full).
368+ // // return std_all_of(bc::seq, txs.begin(), txs.end(),
369+ // // [&](const tx_link& fk) NOEXCEPT
370+ // // {
371+ // // return store_.validated_tx.put(fk, table::validated_tx::slab
372+ // // {
373+ // // {},
374+ // // ctx,
375+ // // schema::tx_state::connected,
376+ // // fee,
377+ // // system::possible_narrow_cast<sigs::integer>(sigops)
378+ // // });
379+ // // });
380+ // // // ========================================================================
381+ // // }
404382
405383} // namespace database
406384} // namespace libbitcoin
0 commit comments