diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-12-13 19:47:47 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2019-03-25 13:43:17 +0000 |
commit | 547a9708de91c175ceab0ddde93785ba93c9efca (patch) | |
tree | cfaa3baf0447a7e4104c5416c091ffcb539ae5e2 /src/cryptonote_basic/cryptonote_format_utils.h | |
parent | blockchain: avoid unneeded block copy (diff) | |
download | monero-547a9708de91c175ceab0ddde93785ba93c9efca.tar.xz |
cryptonote: block parsing + hash calculation speedup
This saves a duplicate serialization step
Diffstat (limited to 'src/cryptonote_basic/cryptonote_format_utils.h')
-rw-r--r-- | src/cryptonote_basic/cryptonote_format_utils.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/cryptonote_basic/cryptonote_format_utils.h b/src/cryptonote_basic/cryptonote_format_utils.h index 40a9907be..3f8eef076 100644 --- a/src/cryptonote_basic/cryptonote_format_utils.h +++ b/src/cryptonote_basic/cryptonote_format_utils.h @@ -114,12 +114,14 @@ namespace cryptonote crypto::hash get_pruned_transaction_hash(const transaction& t, const crypto::hash &pruned_data_hash); blobdata get_block_hashing_blob(const block& b); - bool calculate_block_hash(const block& b, crypto::hash& res); + bool calculate_block_hash(const block& b, crypto::hash& res, const blobdata *blob = NULL); bool get_block_hash(const block& b, crypto::hash& res); crypto::hash get_block_hash(const block& b); bool get_block_longhash(const block& b, crypto::hash& res, uint64_t height); crypto::hash get_block_longhash(const block& b, uint64_t height); + bool parse_and_validate_block_from_blob(const blobdata& b_blob, block& b, crypto::hash *block_hash); bool parse_and_validate_block_from_blob(const blobdata& b_blob, block& b); + bool parse_and_validate_block_from_blob(const blobdata& b_blob, block& b, crypto::hash &block_hash); bool get_inputs_money_amount(const transaction& tx, uint64_t& money); uint64_t get_outs_money_amount(const transaction& tx); bool check_inputs_types_supported(const transaction& tx); |