Fixes include:

- setting DEFAULT_STACK_TRACE=OFF for all release builds (prevents boost weak_ptr crash on some Linux systems)
- setting RPC-SSL to disabled by default (fixes "no connection to daemon" error)
- updated BlockchainLMDB::get_circulating_supply() to report staked coins as something other than BURNT
- bumped to v0.4.5
This commit is contained in:
Some Random Crypto Guy
2024-08-16 14:01:11 +01:00
parent beffdd7ed9
commit addd26cd47
8 changed files with 39 additions and 23 deletions
+13 -6
View File
@@ -1478,7 +1478,7 @@ bool Blockchain::validate_miner_transaction(const block& b, size_t cumulative_bl
}
//------------------------------------------------------------------
// SRCG
bool Blockchain::validate_protocol_transaction(const block& b, uint64_t height, std::vector<std::pair<transaction, blobdata>>& txs, const std::map<std::string, uint64_t>& circ_supply, uint8_t hf_version)
bool Blockchain::validate_protocol_transaction(const block& b, uint64_t height, std::vector<std::pair<transaction, blobdata>>& txs, uint8_t hf_version)
{
LOG_PRINT_L3("Blockchain::" << __func__);
CHECK_AND_ASSERT_MES(b.tx_hashes.size() == txs.size(), false, "Invalid number of TXs / hashes supplied");
@@ -1488,6 +1488,17 @@ bool Blockchain::validate_protocol_transaction(const block& b, uint64_t height,
CHECK_AND_ASSERT_MES(b.protocol_tx.vout.size() == 0, false, "void protocol transaction in the block has outputs");
return true;
}
if (!b.protocol_tx.vout.size()) {
// No money is minted, nothing to verify - bail out
return true;
}
// Get the circulating supply so we can verify
std::map<std::string, uint64_t> circ_supply;
if (hf_version >= HF_VERSION_ENABLE_CONVERT) {
circ_supply = get_db().get_circulating_supply();
}
// Build a map of outputs from the protocol_tx
std::map<crypto::public_key, std::tuple<std::string, uint64_t, uint64_t>> outputs;
@@ -4900,12 +4911,8 @@ leave:
}
TIME_MEASURE_FINISH(vmt);
TIME_MEASURE_START(gcs);
std::map<std::string, uint64_t> circ_supply = get_db().get_circulating_supply();
TIME_MEASURE_FINISH(gcs);
TIME_MEASURE_START(vpt);
if(!validate_protocol_transaction(bl, blockchain_height, txs, circ_supply, m_hardfork->get_current_version()))
if(!validate_protocol_transaction(bl, blockchain_height, txs, m_hardfork->get_current_version()))
{
MERROR_VER("Block with id: " << id << " has incorrect protocol transaction");
bvc.m_verifivation_failed = true;
+1 -1
View File
@@ -1521,7 +1521,7 @@ namespace cryptonote
*
* @return false if anything is found wrong with the protocol transaction, otherwise true
*/
bool validate_protocol_transaction(const block& b, uint64_t height, std::vector<std::pair<transaction, blobdata>>& txs, const std::map<std::string, uint64_t>& circ_supply, uint8_t hf_version);
bool validate_protocol_transaction(const block& b, uint64_t height, std::vector<std::pair<transaction, blobdata>>& txs, uint8_t hf_version);
/**
* @brief reverts the blockchain to its previous state following a failed switch