Mac ARM64 builds working with depends

This commit is contained in:
Some Random Crypto Guy
2024-06-17 11:52:11 +01:00
parent 7f64a43de9
commit 6d695e0005
97 changed files with 3450 additions and 3743 deletions
+1
View File
@@ -53,6 +53,7 @@ target_link_libraries(cryptonote_core
blockchain_db
ringct
device
oracle
hardforks
${Boost_DATE_TIME_LIBRARY}
${Boost_PROGRAM_OPTIONS_LIBRARY}
+2
View File
@@ -1708,5 +1708,7 @@ namespace cryptonote
* @param already_generated_coins total coins mined by the network so far
*/
void send_miner_notifications(uint64_t height, const crypto::hash &seed_hash, const crypto::hash &prev_id, uint64_t already_generated_coins);
friend struct BlockchainAndPool;
};
} // namespace cryptonote
+62
View File
@@ -0,0 +1,62 @@
// Copyright (c) 2023, The Monero Project
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice,
// this list of
// conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright notice,
// this list
// of conditions and the following disclaimer in the documentation and/or
// other materials provided with the distribution.
//
// 3. Neither the name of the copyright holder nor the names of its contributors
// may be
// used to endorse or promote products derived from this software without
// specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
#pragma once
#include <memory>
#include "blockchain.h"
#include "tx_pool.h"
#include "warnings.h"
namespace cryptonote
{
/**
* @brief Container for safely constructing Blockchain and tx_memory_pool classes
*
* The reason for this class existing is that the constructors for both Blockchain and
* tx_memory_pool take a reference for tx_memory_pool and Blockchain, respectively. Because of this
* circular reference, it is annoying/unsafe to construct these normally. This class guarantees that
* we don't make any silly mistakes with pointers / dangling references.
*/
struct BlockchainAndPool
{
Blockchain blockchain;
tx_memory_pool tx_pool;
PUSH_WARNINGS
DISABLE_GCC_WARNING(uninitialized)
BlockchainAndPool(): blockchain(tx_pool), tx_pool(blockchain) {}
POP_WARNINGS
};
}
+3 -2
View File
@@ -226,8 +226,9 @@ namespace cryptonote
//-----------------------------------------------------------------------------------------------
core::core(i_cryptonote_protocol* pprotocol):
m_mempool(m_blockchain_storage),
m_blockchain_storage(m_mempool),
m_bap(),
m_mempool(m_bap.tx_pool),
m_blockchain_storage(m_bap.blockchain),
m_miner(this, [this](const cryptonote::block &b, uint64_t height, const crypto::hash *seed_hash, unsigned int threads, crypto::hash &hash) {
return cryptonote::get_block_longhash(&m_blockchain_storage, b, hash, height, seed_hash, threads);
}),
+4 -4
View File
@@ -42,8 +42,7 @@
#include "cryptonote_protocol/enums.h"
#include "common/download.h"
#include "common/command_line.h"
#include "tx_pool.h"
#include "blockchain.h"
#include "blockchain_and_pool.h"
#include "cryptonote_basic/miner.h"
#include "cryptonote_basic/connection_context.h"
#include "warnings.h"
@@ -1098,8 +1097,9 @@ namespace cryptonote
uint64_t m_test_drop_download_height = 0; //!< height under which to drop incoming blocks, if doing so
tx_memory_pool m_mempool; //!< transaction pool instance
Blockchain m_blockchain_storage; //!< Blockchain instance
BlockchainAndPool m_bap; //! Contains owned instances of Blockchain and tx_memory_pool
tx_memory_pool& m_mempool; //!< transaction pool instance
Blockchain& m_blockchain_storage; //!< Blockchain instance
i_cryptonote_protocol* m_pprotocol; //!< cryptonote protocol instance
+9 -7
View File
@@ -98,13 +98,6 @@ namespace cryptonote
class tx_memory_pool: boost::noncopyable
{
public:
/**
* @brief Constructor
*
* @param bchs a Blockchain class instance, for getting chain info
*/
tx_memory_pool(Blockchain& bchs);
/**
* @copydoc add_tx(transaction&, tx_verification_context&, bool, bool, uint8_t)
@@ -492,6 +485,13 @@ namespace cryptonote
private:
/**
* @brief Constructor
*
* @param bchs a Blockchain class instance, for getting chain info
*/
tx_memory_pool(Blockchain& bchs);
/**
* @brief insert key images into m_spent_key_images
*
@@ -680,6 +680,8 @@ private:
//! Next timestamp that a DB check for relayable txes is allowed
std::atomic<time_t> m_next_check;
friend struct BlockchainAndPool;
};
}