mirror of https://github.com/oxen-io/oxen-core.git
blockchain: Log more useful data
This commit is contained in:
parent
fc2614e714
commit
4d589f7cec
|
@ -39,6 +39,7 @@
|
|||
#include "file_io_utils.h"
|
||||
#include "common/file.h"
|
||||
#include "common/pruning.h"
|
||||
#include "common/hex.h"
|
||||
#include "cryptonote_basic/cryptonote_format_utils.h"
|
||||
#include "crypto/crypto.h"
|
||||
#include "profile_tools.h"
|
||||
|
@ -2588,7 +2589,7 @@ uint64_t BlockchainLMDB::get_block_height(const crypto::hash& h) const
|
|||
MDB_val_set(key, h);
|
||||
auto get_result = mdb_cursor_get(m_cur_block_heights, (MDB_val *)&zerokval, &key, MDB_GET_BOTH);
|
||||
if (get_result == MDB_NOTFOUND)
|
||||
throw1(BLOCK_DNE("Attempted to retrieve non-existent block height"));
|
||||
throw1(BLOCK_DNE("Attempted to retrieve non-existent block height from hash " + tools::type_to_hex(h)));
|
||||
else if (get_result)
|
||||
throw0(DB_ERROR("Error attempting to retrieve a block height from the db"));
|
||||
|
||||
|
|
|
@ -1424,6 +1424,7 @@ namespace service_nodes
|
|||
catch(std::exception const &e)
|
||||
{
|
||||
// ignore not found block, try alt db
|
||||
LOG_PRINT_L1("Block " << hash << " not found in main DB, searching alt DB");
|
||||
cryptonote::alt_block_data_t alt_data;
|
||||
cryptonote::blobdata blob;
|
||||
if (!db.get_alt_block(hash, &alt_data, &blob, nullptr))
|
||||
|
@ -1433,7 +1434,10 @@ namespace service_nodes
|
|||
}
|
||||
|
||||
if (!cryptonote::parse_and_validate_block_from_blob(blob, block, nullptr))
|
||||
{
|
||||
MERROR("Failed to parse alt block blob at " << alt_data.height << ":" << hash);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -366,7 +366,10 @@ namespace service_nodes
|
|||
}
|
||||
|
||||
if (!verify_quorum_signatures(quorum, quorum_type::checkpointing, hf_version, checkpoint.height, checkpoint.block_hash, checkpoint.signatures, std::any{}))
|
||||
{
|
||||
LOG_PRINT_L1("Checkpoint failed signature validation at block " << checkpoint.height << " " << checkpoint.block_hash);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue