wallet2: validate block hash when repairing empty hashchain

(cherry picked from commit ef7bdda92af255270a61e4ea4c6c7fe098a70dd0)
This commit is contained in:
selsta
2026-10-04 18:50:24 -04:00
committed by such-gitea
parent 7e797d062a
commit c017fff2ec
+2 -1
View File
@@ -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(...)