Avoid repeated (de)serialization when syncing

This commit is contained in:
moneromooo-monero 2018-11-11 14:51:03 +00:00
parent b747e836c8
commit b044d03a51
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3
13 changed files with 80 additions and 69 deletions

View file

@ -129,7 +129,7 @@ static void test(test_t t, uint64_t blocks)
cryptonote::block b;
b.major_version = 1;
b.minor_version = 1;
bc->get_db().add_block(b, 300000, 300000, bc->get_db().height(), bc->get_db().height(), {});
bc->get_db().add_block(std::make_pair(b, ""), 300000, 300000, bc->get_db().height(), bc->get_db().height(), {});
if (!bc->update_next_cumulative_weight_limit())
{
fprintf(stderr, "Failed to update cumulative weight limit 1\n");
@ -163,7 +163,7 @@ static void test(test_t t, uint64_t blocks)
cryptonote::block b;
b.major_version = 10;
b.minor_version = 10;
bc->get_db().add_block(std::move(b), w, ltw, bc->get_db().height(), bc->get_db().height(), {});
bc->get_db().add_block(std::make_pair(std::move(b), ""), w, ltw, bc->get_db().height(), bc->get_db().height(), {});
if (!bc->update_next_cumulative_weight_limit())
{