mirror of
https://github.com/monero-project/monero.git
synced 2025-08-03 23:44:19 -04:00
Merge pull request #7661
08e4497
Improve cryptonote (block and tx) binary read performance (Lee Clagett)
This commit is contained in:
commit
7499837a6f
29 changed files with 229 additions and 230 deletions
|
@ -648,11 +648,9 @@ public:
|
|||
bvc.m_verifivation_failed = true;
|
||||
|
||||
cryptonote::block blk;
|
||||
std::stringstream ss;
|
||||
ss << sr_block.data;
|
||||
binary_archive<false> ba(ss);
|
||||
binary_archive<false> ba{epee::strspan<std::uint8_t>(sr_block.data)};
|
||||
::serialization::serialize(ba, blk);
|
||||
if (!ss.good())
|
||||
if (!ba.good())
|
||||
{
|
||||
blk = cryptonote::block();
|
||||
}
|
||||
|
@ -671,11 +669,9 @@ public:
|
|||
bool tx_added = pool_size + 1 == m_c.get_pool_transactions_count();
|
||||
|
||||
cryptonote::transaction tx;
|
||||
std::stringstream ss;
|
||||
ss << sr_tx.data;
|
||||
binary_archive<false> ba(ss);
|
||||
binary_archive<false> ba{epee::strspan<std::uint8_t>(sr_tx.data)};
|
||||
::serialization::serialize(ba, tx);
|
||||
if (!ss.good())
|
||||
if (!ba.good())
|
||||
{
|
||||
tx = cryptonote::transaction();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue