mirror of
https://github.com/wownero/wownero.git
synced 2026-10-17 07:31:35 +02:00
wallet2: validate block hash when repairing empty hashchain
(cherry picked from commit ef7bdda92af255270a61e4ea4c6c7fe098a70dd0)
This commit is contained in:
@@ -6828,7 +6828,8 @@ void wallet2::trim_hashchain()
|
||||
if (m_node_rpc_proxy.get_block_header_by_height(m_blockchain.size() - 1, block_header))
|
||||
throw std::runtime_error("Failed to request block header by height");
|
||||
crypto::hash hash;
|
||||
epee::string_tools::hex_to_pod(block_header.hash, hash);
|
||||
THROW_WALLET_EXCEPTION_IF(!epee::string_tools::hex_to_pod(block_header.hash, hash),
|
||||
error::wallet_internal_error, "Daemon returned an invalid block hash");
|
||||
m_blockchain.refill(hash);
|
||||
}
|
||||
catch(...)
|
||||
|
||||
Reference in New Issue
Block a user