mirror of
https://github.com/wownero/wownero.git
synced 2026-12-04 23:13:59 +01:00
FCMP++/Carrot mega commit [9/14/26]
Co-authored-by: jeffro256 <jeffro256@tutanota.com> Co-authored-by: Luke Parker <lukeparker5132@gmail.com> Co-authored-by: Lee *!* Clagett <code@leeclagett.com> Co-authored-by: SyntheticBird45 <someoneelse.is_on.github.rio7x@simplelogin.com> Co-authored-by: jeetrex17 <jeetrex@tutamail.com> Co-authored-by: UkoeHB <ukoehb@users.noreply.github.com> Co-authored-by: MrCyjaneK Co-authored-by: tobtoht Co-authored-by: selsta Co-authored-by: Thomas <thomas.giudici@proton.me> Co-authored-by: navidR Co-authored-by: Boog900 <boog900@tutanota.com>
This commit is contained in:
co-authored by
jeffro256
Luke Parker
Lee *!* Clagett
SyntheticBird45
jeetrex17
UkoeHB
MrCyjaneK
tobtoht
selsta
Thomas
navidR
Boog900
parent
9e3a31032e
commit
a9145f9d38
@@ -60,7 +60,11 @@ namespace
|
||||
}
|
||||
|
||||
namespace cryptonote {
|
||||
class blockchain_storage;
|
||||
class blockchain_storage
|
||||
{
|
||||
public:
|
||||
bool have_tx(const crypto::hash &id) const { return false; }
|
||||
};
|
||||
}
|
||||
|
||||
class test_core : public cryptonote::i_core_events
|
||||
@@ -77,7 +81,7 @@ public:
|
||||
bool have_block(const crypto::hash& id, int *where = NULL) const {return false;}
|
||||
bool have_block_unlocked(const crypto::hash& id, int *where = NULL) const {return false;}
|
||||
void get_blockchain_top(uint64_t& height, crypto::hash& top_id)const{height=0;top_id=crypto::null_hash;}
|
||||
bool handle_incoming_tx(const cryptonote::blobdata& tx_blob, cryptonote::tx_verification_context& tvc, cryptonote::relay_method tx_relay, bool relayed) { return true; }
|
||||
bool handle_incoming_tx(const cryptonote::blobdata& tx_blob, cryptonote::transaction& tx, crypto::hash& txid, cryptonote::tx_verification_context& tvc, cryptonote::relay_method tx_relay, bool relayed) { return true; }
|
||||
bool handle_single_incoming_block(const cryptonote::blobdata& block_blob, const cryptonote::block *b, cryptonote::block_verification_context& bvc, cryptonote::pool_supplement& extra_block_txs, bool update_miner_blocktemplate = true) { return true; }
|
||||
bool handle_incoming_block(const cryptonote::blobdata& block_blob, const cryptonote::block *block, cryptonote::block_verification_context& bvc, bool update_miner_blocktemplate = true) { return true; }
|
||||
bool handle_incoming_block(const cryptonote::blobdata& block_blob, const cryptonote::block *block, cryptonote::block_verification_context& bvc, cryptonote::pool_supplement& extra_block_txs, bool update_miner_blocktemplate = true) { return true; }
|
||||
@@ -112,7 +116,7 @@ public:
|
||||
bool prune_blockchain(uint32_t pruning_seed = 0) { return true; }
|
||||
bool is_within_compiled_block_hash_area(uint64_t height) const { return false; }
|
||||
bool has_block_weights(uint64_t height, uint64_t nblocks) const { return false; }
|
||||
bool get_txpool_complement(const std::vector<crypto::hash> &hashes, std::vector<cryptonote::blobdata> &txes) { return false; }
|
||||
bool get_txpool_complement(const std::vector<crypto::hash> &hashes, std::vector<crypto::hash> &inv_txes) { return false; }
|
||||
bool get_pool_transaction_hashes(std::vector<crypto::hash>& txs, bool include_unrelayed_txes = true) const { return false; }
|
||||
crypto::hash get_block_id_by_height(uint64_t height) const { return crypto::null_hash; }
|
||||
void stop() {}
|
||||
@@ -863,7 +867,7 @@ TEST(cryptonote_protocol_handler, race_condition)
|
||||
const stat::chain &stat
|
||||
){
|
||||
core.get_blockchain_storage().get_db().batch_start({}, {});
|
||||
core.get_blockchain_storage().get_db().add_block(
|
||||
uint64_t new_height = core.get_blockchain_storage().get_db().add_block(
|
||||
{block, cryptonote::block_to_blob(block)},
|
||||
cryptonote::get_transaction_weight(block.miner_tx),
|
||||
core.get_blockchain_storage().get_next_long_term_block_weight(
|
||||
@@ -871,8 +875,10 @@ TEST(cryptonote_protocol_handler, race_condition)
|
||||
),
|
||||
stat.diff,
|
||||
stat.reward,
|
||||
{},
|
||||
{}
|
||||
);
|
||||
core.get_blockchain_storage().get_db().advance_tree(new_height - 1, {});
|
||||
core.get_blockchain_storage().get_db().batch_stop();
|
||||
};
|
||||
struct messages {
|
||||
@@ -887,6 +893,7 @@ TEST(cryptonote_protocol_handler, race_condition)
|
||||
using uuid_t = boost::uuids::uuid;
|
||||
using relay_t = cryptonote::relay_method;
|
||||
using blobs_t = std::vector<cryptonote::blobdata>;
|
||||
using hashes_t = std::vector<crypto::hash>;
|
||||
using id_t = nodetool::peerid_type;
|
||||
using callback_t = std::function<bool(contexts::cryptonote &, id_t, uint32_t)>;
|
||||
using address_t = epee::net_utils::network_address;
|
||||
@@ -973,7 +980,7 @@ TEST(cryptonote_protocol_handler, race_condition)
|
||||
virtual bool unblock_host(const address_t&) override {
|
||||
return {};
|
||||
}
|
||||
virtual zone_t send_txs(blobs_t, const zone_t, const uuid_t&, relay_t) override {
|
||||
virtual zone_t send_txs(blobs_t, hashes_t&&, const zone_t, const uuid_t&, relay_t) override {
|
||||
return {};
|
||||
}
|
||||
virtual bans::subnets get_blocked_subnets() override {
|
||||
@@ -1408,6 +1415,7 @@ TEST(node_server, race_condition)
|
||||
}
|
||||
p2p_endpoint->send_txs(
|
||||
std::move(txs),
|
||||
std::vector<crypto::hash>(txs.size()),
|
||||
epee::net_utils::zone::public_,
|
||||
{},
|
||||
relay_t::fluff
|
||||
|
||||
Reference in New Issue
Block a user