Skip to content

Commit

Permalink
Update r/w commands.
Browse files Browse the repository at this point in the history
  • Loading branch information
evoskuil committed Apr 21, 2024
1 parent aac8c4b commit 7266585
Showing 1 changed file with 49 additions and 21 deletions.
70 changes: 49 additions & 21 deletions console/executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -700,29 +700,10 @@ void executor::scan_collisions() const
spend.shrink_to_fit();
}

////// arbitrary testing (const).
////void executor::read_test() const
////{
//// console("No read test implemented.");
////}

// arbitrary testing (const).
void executor::read_test() const
{
code ec{};
size_t count{};
const auto start = unix_time();

for (size_t height = zero;
!cancel_ && !ec && height <= query_.get_top_confirmed();
++height, ++count)
{
ec = query_.block_confirmable(query_.to_confirmed(height));

if (is_zero(height % 100_size))
console(format("Confirm [%1%] test (%2%).") % height % ec.message());
}

console(format("%1% confirmed in %2% secs.") % count % (unix_time() - start));
console("No read test implemented.");
}

// This was caused by concurrent redundant downloads at tail following restart.
Expand Down Expand Up @@ -1227,6 +1208,53 @@ void executor::write_test()
console("No write test implemented.");
}

////void executor::write_test()
////{
//// code ec{};
//// size_t count{};
//// const auto start = unix_time();
////
//// for (size_t height = 804'001_size;
//// !cancel_ && !ec && height <= query_.get_top_candidate();
//// ++height, ++count)
//// {
//// const auto block = query_.to_candidate(height);
//// if (!query_.set_strong(block))
//// {
//// // top associated
//// if (height == 839'368_size)
//// break;
////
//// console(format("set_strong [%1%] fault.") % height);
//// return;
//// }
////
//// ////if (height > 804'000_size)
//// if (ec = query_.block_confirmable(block))
//// {
//// console(format("block_confirmable [%1%] fault (%2%).") % height % ec.message());
//// return;
//// }
////
//// if (!query_.set_block_confirmable(block, uint64_t{}))
//// {
//// console(format("set_block_confirmable [%1%] fault.") % height);
//// return;
//// }
////
//// if (!query_.push_confirmed(block))
//// {
//// console(format("push_confirmed [%1%] fault.") % height);
//// return;
//// }
////
//// if (is_zero(height % 100_size))
//// console(format("write_test [%1%].") % height);
//// }
////
//// console(format("%1% blocks in %2% secs.") % count % (unix_time() - start));
////}

////void executor::write_test()
////{
//// using namespace database;
Expand Down

0 comments on commit 7266585

Please sign in to comment.