diff options
Diffstat (limited to '')
-rw-r--r-- | src/blockchain_db/blockchain_db.h | 10 | ||||
-rw-r--r-- | src/blockchain_db/lmdb/db_lmdb.cpp | 14 | ||||
-rw-r--r-- | src/blockchain_db/lmdb/db_lmdb.h | 2 | ||||
-rw-r--r-- | src/cryptonote_core/blockchain.cpp | 4 | ||||
-rw-r--r-- | src/cryptonote_core/blockchain.h | 6 | ||||
-rw-r--r-- | src/cryptonote_core/cryptonote_core.cpp | 15 | ||||
-rw-r--r-- | src/cryptonote_core/cryptonote_core.h | 7 | ||||
-rw-r--r-- | src/cryptonote_core/tx_pool.cpp | 30 | ||||
-rw-r--r-- | src/cryptonote_core/tx_pool.h | 7 | ||||
-rw-r--r-- | src/daemon/rpc_command_executor.cpp | 46 | ||||
-rw-r--r-- | src/rpc/core_rpc_server.cpp | 8 | ||||
-rw-r--r-- | src/rpc/core_rpc_server.h | 2 | ||||
-rw-r--r-- | src/rpc/core_rpc_server_commands_defs.h | 47 | ||||
-rw-r--r-- | src/wallet/wallet2.cpp | 8 | ||||
-rw-r--r-- | tests/unit_tests/hardfork.cpp | 2 |
15 files changed, 154 insertions, 54 deletions
diff --git a/src/blockchain_db/blockchain_db.h b/src/blockchain_db/blockchain_db.h index 9dd343f4b..b0a3d84e1 100644 --- a/src/blockchain_db/blockchain_db.h +++ b/src/blockchain_db/blockchain_db.h @@ -1353,10 +1353,10 @@ public: virtual bool for_all_key_images(std::function<bool(const crypto::key_image&)>) const = 0; /** - * @brief runs a function over all blocks stored + * @brief runs a function over a range of blocks * - * The subclass should run the passed function for each block it has - * stored, passing (block_height, block_hash, block) as its parameters. + * The subclass should run the passed function for each block in the + * specified range, passing (block_height, block_hash, block) as its parameters. * * If any call to the function returns false, the subclass should return * false. Otherwise, the subclass returns true. @@ -1364,11 +1364,13 @@ public: * The subclass should throw DB_ERROR if any of the expected values are * not found. Current implementations simply return false. * + * @param h1 the start height + * @param h2 the end height * @param std::function fn the function to run * * @return false if the function returns false for any block, otherwise true */ - virtual bool for_all_blocks(std::function<bool(uint64_t, const crypto::hash&, const cryptonote::block&)>) const = 0; + virtual bool for_blocks_range(const uint64_t& h1, const uint64_t& h2, std::function<bool(uint64_t, const crypto::hash&, const cryptonote::block&)>) const = 0; /** * @brief runs a function over all transactions stored diff --git a/src/blockchain_db/lmdb/db_lmdb.cpp b/src/blockchain_db/lmdb/db_lmdb.cpp index 1f0831874..d7947c8d0 100644 --- a/src/blockchain_db/lmdb/db_lmdb.cpp +++ b/src/blockchain_db/lmdb/db_lmdb.cpp @@ -2380,7 +2380,7 @@ bool BlockchainLMDB::for_all_key_images(std::function<bool(const crypto::key_ima return ret; } -bool BlockchainLMDB::for_all_blocks(std::function<bool(uint64_t, const crypto::hash&, const cryptonote::block&)> f) const +bool BlockchainLMDB::for_blocks_range(const uint64_t& h1, const uint64_t& h2, std::function<bool(uint64_t, const crypto::hash&, const cryptonote::block&)> f) const { LOG_PRINT_L3("BlockchainLMDB::" << __func__); check_open(); @@ -2392,7 +2392,15 @@ bool BlockchainLMDB::for_all_blocks(std::function<bool(uint64_t, const crypto::h MDB_val v; bool ret = true; - MDB_cursor_op op = MDB_FIRST; + MDB_cursor_op op; + if (h1) + { + MDB_val_set(k, h1); + op = MDB_SET; + } else + { + op = MDB_FIRST; + } while (1) { int ret = mdb_cursor_get(m_cur_blocks, &k, &v, op); @@ -2414,6 +2422,8 @@ bool BlockchainLMDB::for_all_blocks(std::function<bool(uint64_t, const crypto::h ret = false; break; } + if (height >= h2) + break; } TXN_POSTFIX_RDONLY(); diff --git a/src/blockchain_db/lmdb/db_lmdb.h b/src/blockchain_db/lmdb/db_lmdb.h index 02f57ce18..540fababb 100644 --- a/src/blockchain_db/lmdb/db_lmdb.h +++ b/src/blockchain_db/lmdb/db_lmdb.h @@ -249,7 +249,7 @@ public: virtual bool for_all_txpool_txes(std::function<bool(const crypto::hash&, const txpool_tx_meta_t&, const cryptonote::blobdata*)> f, bool include_blob = false) const; virtual bool for_all_key_images(std::function<bool(const crypto::key_image&)>) const; - virtual bool for_all_blocks(std::function<bool(uint64_t, const crypto::hash&, const cryptonote::block&)>) const; + virtual bool for_blocks_range(const uint64_t& h1, const uint64_t& h2, std::function<bool(uint64_t, const crypto::hash&, const cryptonote::block&)>) const; virtual bool for_all_transactions(std::function<bool(const crypto::hash&, const cryptonote::transaction&)>) const; virtual bool for_all_outputs(std::function<bool(uint64_t amount, const crypto::hash &tx_hash, size_t tx_idx)> f) const; diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp index 7fb85ee76..6f2977c5b 100644 --- a/src/cryptonote_core/blockchain.cpp +++ b/src/cryptonote_core/blockchain.cpp @@ -4164,9 +4164,9 @@ bool Blockchain::for_all_key_images(std::function<bool(const crypto::key_image&) return m_db->for_all_key_images(f); } -bool Blockchain::for_all_blocks(std::function<bool(uint64_t, const crypto::hash&, const block&)> f) const +bool Blockchain::for_blocks_range(const uint64_t& h1, const uint64_t& h2, std::function<bool(uint64_t, const crypto::hash&, const block&)> f) const { - return m_db->for_all_blocks(f); + return m_db->for_blocks_range(h1, h2, f); } bool Blockchain::for_all_transactions(std::function<bool(const crypto::hash&, const cryptonote::transaction&)> f) const diff --git a/src/cryptonote_core/blockchain.h b/src/cryptonote_core/blockchain.h index 89efe5452..52172012c 100644 --- a/src/cryptonote_core/blockchain.h +++ b/src/cryptonote_core/blockchain.h @@ -790,13 +790,15 @@ namespace cryptonote bool for_all_key_images(std::function<bool(const crypto::key_image&)>) const; /** - * @brief perform a check on all blocks in the blockchain + * @brief perform a check on all blocks in the blockchain in the given range * + * @param h1 the start height + * @param h2 the end height * @param std::function the check to perform, pass/fail * * @return false if any block fails the check, otherwise true */ - bool for_all_blocks(std::function<bool(uint64_t, const crypto::hash&, const block&)>) const; + bool for_blocks_range(const uint64_t& h1, const uint64_t& h2, std::function<bool(uint64_t, const crypto::hash&, const block&)>) const; /** * @brief perform a check on all transactions in the blockchain diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp index 21b0b4ceb..c601c066c 100644 --- a/src/cryptonote_core/cryptonote_core.cpp +++ b/src/cryptonote_core/cryptonote_core.cpp @@ -713,12 +713,13 @@ namespace cryptonote //----------------------------------------------------------------------------------------------- std::pair<uint64_t, uint64_t> core::get_coinbase_tx_sum(const uint64_t start_offset, const size_t count) { - std::list<block> blocks; uint64_t emission_amount = 0; uint64_t total_fee_amount = 0; - this->get_blocks(start_offset, count, blocks); - for(auto& b: blocks) + if (count) { + const uint64_t end = start_offset + count - 1; + m_blockchain_storage.for_blocks_range(start_offset, end, + [this, &emission_amount, &total_fee_amount](uint64_t, const crypto::hash& hash, const block& b){ std::list<transaction> txs; std::list<crypto::hash> missed_txs; uint64_t coinbase_amount = get_outs_money_amount(b.miner_tx); @@ -731,6 +732,8 @@ namespace cryptonote emission_amount += coinbase_amount - tx_fee_amount; total_fee_amount += tx_fee_amount; + return true; + }); } return std::pair<uint64_t, uint64_t>(emission_amount, total_fee_amount); @@ -1046,6 +1049,12 @@ namespace cryptonote return true; } //----------------------------------------------------------------------------------------------- + bool core::get_pool_transaction_stats(struct txpool_stats& stats) const + { + m_mempool.get_transaction_stats(stats); + return true; + } + //----------------------------------------------------------------------------------------------- bool core::get_pool_transaction(const crypto::hash &id, cryptonote::blobdata& tx) const { return m_mempool.get_transaction(id, tx); diff --git a/src/cryptonote_core/cryptonote_core.h b/src/cryptonote_core/cryptonote_core.h index 5e66af545..e5fbf7f91 100644 --- a/src/cryptonote_core/cryptonote_core.h +++ b/src/cryptonote_core/cryptonote_core.h @@ -411,6 +411,13 @@ namespace cryptonote bool get_pool_transaction_hashes(std::vector<crypto::hash>& txs) const; /** + * @copydoc tx_memory_pool::get_transactions + * + * @note see tx_memory_pool::get_transactions + */ + bool get_pool_transaction_stats(struct txpool_stats& stats) const; + + /** * @copydoc tx_memory_pool::get_transaction * * @note see tx_memory_pool::get_transaction diff --git a/src/cryptonote_core/tx_pool.cpp b/src/cryptonote_core/tx_pool.cpp index 30aed50f9..515918cfa 100644 --- a/src/cryptonote_core/tx_pool.cpp +++ b/src/cryptonote_core/tx_pool.cpp @@ -107,6 +107,9 @@ namespace cryptonote //--------------------------------------------------------------------------------- bool tx_memory_pool::add_tx(transaction &tx, /*const crypto::hash& tx_prefix_hash,*/ const crypto::hash &id, size_t blob_size, tx_verification_context& tvc, bool kept_by_block, bool relayed, bool do_not_relay, uint8_t version) { + // this should already be called with that lock, but let's make it explicit for clarity + CRITICAL_REGION_LOCAL(m_transactions_lock); + PERF_TIMER(add_tx); if (tx.version == 0) { @@ -224,6 +227,7 @@ namespace cryptonote meta.do_not_relay = do_not_relay; try { + CRITICAL_REGION_LOCAL1(m_blockchain); LockedTXN lock(m_blockchain); m_blockchain.add_txpool_tx(tx, meta); if (!insert_key_images(tx, kept_by_block)) @@ -260,6 +264,7 @@ namespace cryptonote try { + CRITICAL_REGION_LOCAL1(m_blockchain); LockedTXN lock(m_blockchain); m_blockchain.remove_txpool_tx(get_transaction_hash(tx)); m_blockchain.add_txpool_tx(tx, meta); @@ -546,6 +551,31 @@ namespace cryptonote }); } //------------------------------------------------------------------ + void tx_memory_pool::get_transaction_stats(struct txpool_stats& stats) const + { + CRITICAL_REGION_LOCAL(m_transactions_lock); + CRITICAL_REGION_LOCAL1(m_blockchain); + const uint64_t now = time(NULL); + stats.txs_total = m_blockchain.get_txpool_tx_count(); + m_blockchain.for_all_txpool_txes([&stats, now](const crypto::hash &txid, const txpool_tx_meta_t &meta, const cryptonote::blobdata *bd){ + stats.bytes_total += meta.blob_size; + if (!stats.bytes_min || meta.blob_size < stats.bytes_min) + stats.bytes_min = meta.blob_size; + if (meta.blob_size > stats.bytes_max) + stats.bytes_max = meta.blob_size; + if (!meta.relayed) + stats.num_not_relayed++; + stats.fee_total += meta.fee; + if (!stats.oldest || meta.receive_time < stats.oldest) + stats.oldest = meta.receive_time; + if (meta.receive_time < now - 600) + stats.num_10m++; + if (meta.last_failed_height) + stats.num_failing++; + return true; + }); + } + //------------------------------------------------------------------ //TODO: investigate whether boolean return is appropriate bool tx_memory_pool::get_transactions_and_spent_keys_info(std::vector<tx_info>& tx_infos, std::vector<spent_key_image_info>& key_image_infos) const { diff --git a/src/cryptonote_core/tx_pool.h b/src/cryptonote_core/tx_pool.h index a2ab76959..1858ccdd8 100644 --- a/src/cryptonote_core/tx_pool.h +++ b/src/cryptonote_core/tx_pool.h @@ -243,6 +243,13 @@ namespace cryptonote void get_transaction_hashes(std::vector<crypto::hash>& txs) const; /** + * @brief get a summary statistics of all transaction hashes in the pool + * + * @param stats return-by-reference the pool statistics + */ + void get_transaction_stats(struct txpool_stats& stats) const; + + /** * @brief get information about all transactions and key images in the pool * * see documentation on tx_info and spent_key_image_info for more details diff --git a/src/daemon/rpc_command_executor.cpp b/src/daemon/rpc_command_executor.cpp index 31f432918..d5bde7f09 100644 --- a/src/daemon/rpc_command_executor.cpp +++ b/src/daemon/rpc_command_executor.cpp @@ -911,57 +911,35 @@ bool t_rpc_command_executor::print_transaction_pool_short() { } bool t_rpc_command_executor::print_transaction_pool_stats() { - cryptonote::COMMAND_RPC_GET_TRANSACTION_POOL::request req; - cryptonote::COMMAND_RPC_GET_TRANSACTION_POOL::response res; + cryptonote::COMMAND_RPC_GET_TRANSACTION_POOL_STATS::request req; + cryptonote::COMMAND_RPC_GET_TRANSACTION_POOL_STATS::response res; - std::string fail_message = "Problem fetching transaction pool"; + std::string fail_message = "Problem fetching transaction pool stats"; if (m_is_rpc) { - if (!m_rpc_client->rpc_request(req, res, "/get_transaction_pool", fail_message.c_str())) + if (!m_rpc_client->rpc_request(req, res, "/get_transaction_pool_stats", fail_message.c_str())) { return true; } } else { - if (!m_rpc_server->on_get_transaction_pool(req, res) || res.status != CORE_RPC_STATUS_OK) + memset(&res.pool_stats, 0, sizeof(res.pool_stats)); + if (!m_rpc_server->on_get_transaction_pool_stats(req, res) || res.status != CORE_RPC_STATUS_OK) { tools::fail_msg_writer() << make_error(fail_message, res.status); return true; } } - size_t n_transactions = res.transactions.size(); - size_t bytes = 0, min_bytes = 0, max_bytes = 0; - size_t n_not_relayed = 0; - uint64_t fee = 0; - uint64_t oldest = 0; - size_t n_10m = 0; - size_t n_failing = 0; + size_t n_transactions = res.pool_stats.txs_total; const uint64_t now = time(NULL); - for (const auto &tx_info: res.transactions) - { - bytes += tx_info.blob_size; - if (min_bytes == 0 || tx_info.blob_size < min_bytes) - min_bytes = tx_info.blob_size; - if (tx_info.blob_size > max_bytes) - max_bytes = tx_info.blob_size; - if (!tx_info.relayed) - n_not_relayed++; - fee += tx_info.fee; - if (oldest == 0 || tx_info.receive_time < oldest) - oldest = tx_info.receive_time; - if (tx_info.receive_time < now - 600) - n_10m++; - if (tx_info.last_failed_height) - ++n_failing; - } - size_t avg_bytes = n_transactions ? bytes / n_transactions : 0; - - tools::msg_writer() << n_transactions << " tx(es), " << bytes << " bytes total (min " << min_bytes << ", max " << max_bytes << ", avg " << avg_bytes << ")" << std::endl - << "fees " << cryptonote::print_money(fee) << " (avg " << cryptonote::print_money(n_transactions ? fee / n_transactions : 0) << " per tx" << ", " << cryptonote::print_money(bytes ? fee / bytes : 0) << " per byte )" << std::endl - << n_not_relayed << " not relayed, " << n_failing << " failing, " << n_10m << " older than 10 minutes (oldest " << (oldest == 0 ? "-" : get_human_time_ago(oldest, now)) << ")" << std::endl; + size_t avg_bytes = n_transactions ? res.pool_stats.bytes_total / n_transactions : 0; + + tools::msg_writer() << n_transactions << " tx(es), " << res.pool_stats.bytes_total << " bytes total (min " << res.pool_stats.bytes_min << ", max " << res.pool_stats.bytes_max << ", avg " << avg_bytes << ")" << std::endl + << "fees " << cryptonote::print_money(res.pool_stats.fee_total) << " (avg " << cryptonote::print_money(n_transactions ? res.pool_stats.fee_total / n_transactions : 0) << " per tx" << ", " << cryptonote::print_money(res.pool_stats.bytes_total ? res.pool_stats.fee_total / res.pool_stats.bytes_total : 0) << " per byte )" << std::endl + << res.pool_stats.num_not_relayed << " not relayed, " << res.pool_stats.num_failing << " failing, " << res.pool_stats.num_10m << " older than 10 minutes (oldest " << (res.pool_stats.oldest == 0 ? "-" : get_human_time_ago(res.pool_stats.oldest, now)) << ")" << std::endl; return true; } diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp index 53cfedc04..43891458c 100644 --- a/src/rpc/core_rpc_server.cpp +++ b/src/rpc/core_rpc_server.cpp @@ -797,6 +797,14 @@ namespace cryptonote return true; } //------------------------------------------------------------------------------------------------------------------------------ + bool core_rpc_server::on_get_transaction_pool_stats(const COMMAND_RPC_GET_TRANSACTION_POOL_STATS::request& req, COMMAND_RPC_GET_TRANSACTION_POOL_STATS::response& res) + { + CHECK_CORE_BUSY(); + m_core.get_pool_transaction_stats(res.pool_stats); + res.status = CORE_RPC_STATUS_OK; + return true; + } + //------------------------------------------------------------------------------------------------------------------------------ bool core_rpc_server::on_stop_daemon(const COMMAND_RPC_STOP_DAEMON::request& req, COMMAND_RPC_STOP_DAEMON::response& res) { // FIXME: replace back to original m_p2p.send_stop_signal() after diff --git a/src/rpc/core_rpc_server.h b/src/rpc/core_rpc_server.h index 0aa222c87..44ac6f07a 100644 --- a/src/rpc/core_rpc_server.h +++ b/src/rpc/core_rpc_server.h @@ -93,6 +93,7 @@ namespace cryptonote MAP_URI_AUTO_JON2_IF("/set_log_categories", on_set_log_categories, COMMAND_RPC_SET_LOG_CATEGORIES, !m_restricted) MAP_URI_AUTO_JON2("/get_transaction_pool", on_get_transaction_pool, COMMAND_RPC_GET_TRANSACTION_POOL) MAP_URI_AUTO_JON2("/get_transaction_pool_hashes.bin", on_get_transaction_pool_hashes, COMMAND_RPC_GET_TRANSACTION_POOL_HASHES) + MAP_URI_AUTO_JON2("/get_transaction_pool_stats", on_get_transaction_pool_stats, COMMAND_RPC_GET_TRANSACTION_POOL_STATS) MAP_URI_AUTO_JON2_IF("/stop_daemon", on_stop_daemon, COMMAND_RPC_STOP_DAEMON, !m_restricted) MAP_URI_AUTO_JON2("/getinfo", on_get_info, COMMAND_RPC_GET_INFO) MAP_URI_AUTO_JON2_IF("/out_peers", on_out_peers, COMMAND_RPC_OUT_PEERS, !m_restricted) @@ -148,6 +149,7 @@ namespace cryptonote bool on_set_log_categories(const COMMAND_RPC_SET_LOG_CATEGORIES::request& req, COMMAND_RPC_SET_LOG_CATEGORIES::response& res); bool on_get_transaction_pool(const COMMAND_RPC_GET_TRANSACTION_POOL::request& req, COMMAND_RPC_GET_TRANSACTION_POOL::response& res); bool on_get_transaction_pool_hashes(const COMMAND_RPC_GET_TRANSACTION_POOL_HASHES::request& req, COMMAND_RPC_GET_TRANSACTION_POOL_HASHES::response& res); + bool on_get_transaction_pool_stats(const COMMAND_RPC_GET_TRANSACTION_POOL_STATS::request& req, COMMAND_RPC_GET_TRANSACTION_POOL_STATS::response& res); bool on_stop_daemon(const COMMAND_RPC_STOP_DAEMON::request& req, COMMAND_RPC_STOP_DAEMON::response& res); bool on_out_peers(const COMMAND_RPC_OUT_PEERS::request& req, COMMAND_RPC_OUT_PEERS::response& res); bool on_start_save_graph(const COMMAND_RPC_START_SAVE_GRAPH::request& req, COMMAND_RPC_START_SAVE_GRAPH::response& res); diff --git a/src/rpc/core_rpc_server_commands_defs.h b/src/rpc/core_rpc_server_commands_defs.h index 9bdadf0d1..8b5f189ca 100644 --- a/src/rpc/core_rpc_server_commands_defs.h +++ b/src/rpc/core_rpc_server_commands_defs.h @@ -49,7 +49,7 @@ namespace cryptonote // advance which version they will stop working with // Don't go over 32767 for any of these #define CORE_RPC_VERSION_MAJOR 1 -#define CORE_RPC_VERSION_MINOR 10 +#define CORE_RPC_VERSION_MINOR 11 #define MAKE_CORE_RPC_VERSION(major,minor) (((major)<<16)|(minor)) #define CORE_RPC_VERSION MAKE_CORE_RPC_VERSION(CORE_RPC_VERSION_MAJOR, CORE_RPC_VERSION_MINOR) @@ -1047,6 +1047,51 @@ namespace cryptonote }; }; + struct txpool_stats + { + uint64_t bytes_total; + uint32_t bytes_min; + uint32_t bytes_max; + uint64_t fee_total; + uint64_t oldest; + uint32_t txs_total; + uint32_t num_failing; + uint32_t num_10m; + uint32_t num_not_relayed; + + BEGIN_KV_SERIALIZE_MAP() + KV_SERIALIZE(bytes_total) + KV_SERIALIZE(bytes_min) + KV_SERIALIZE(bytes_max) + KV_SERIALIZE(fee_total) + KV_SERIALIZE(oldest) + KV_SERIALIZE(txs_total) + KV_SERIALIZE(num_failing) + KV_SERIALIZE(num_10m) + KV_SERIALIZE(num_not_relayed) + END_KV_SERIALIZE_MAP() + }; + + struct COMMAND_RPC_GET_TRANSACTION_POOL_STATS + { + struct request + { + BEGIN_KV_SERIALIZE_MAP() + END_KV_SERIALIZE_MAP() + }; + + struct response + { + std::string status; + txpool_stats pool_stats; + + BEGIN_KV_SERIALIZE_MAP() + KV_SERIALIZE(status) + KV_SERIALIZE(pool_stats) + END_KV_SERIALIZE_MAP() + }; + }; + struct COMMAND_RPC_GET_CONNECTIONS { struct request diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index bce2f4730..96ba04c47 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -3930,7 +3930,7 @@ void wallet2::transfer_selected_rct(std::vector<cryptonote::tx_destination_entry // throw if attempting a transaction with no destinations THROW_WALLET_EXCEPTION_IF(dsts.empty(), error::zero_destination); - uint64_t upper_transaction_size_limit = get_upper_tranaction_size_limit(); + uint64_t upper_transaction_size_limit = get_upper_transaction_size_limit(); uint64_t needed_money = fee; LOG_PRINT_L2("transfer_selected_rct: starting with fee " << print_money (needed_money)); LOG_PRINT_L0("selected transfers: "); @@ -4285,7 +4285,7 @@ std::vector<wallet2::pending_tx> wallet2::create_transactions_2(std::vector<cryp std::vector<TX> txes; bool adding_fee; // true if new outputs go towards fee, rather than destinations uint64_t needed_fee, available_for_fee = 0; - uint64_t upper_transaction_size_limit = get_upper_tranaction_size_limit(); + uint64_t upper_transaction_size_limit = get_upper_transaction_size_limit(); const bool use_rct = use_fork_rules(4, 0); const uint64_t fee_per_kb = get_per_kb_fee(); @@ -4621,7 +4621,7 @@ std::vector<wallet2::pending_tx> wallet2::create_transactions_from(const crypton }; std::vector<TX> txes; uint64_t needed_fee, available_for_fee = 0; - uint64_t upper_transaction_size_limit = get_upper_tranaction_size_limit(); + uint64_t upper_transaction_size_limit = get_upper_transaction_size_limit(); std::vector<std::vector<get_outs_entry>> outs; const bool use_rct = fake_outs_count > 0 && use_fork_rules(4, 0); @@ -4779,7 +4779,7 @@ bool wallet2::use_fork_rules(uint8_t version, int64_t early_blocks) return close_enough; } //---------------------------------------------------------------------------------------------------- -uint64_t wallet2::get_upper_tranaction_size_limit() +uint64_t wallet2::get_upper_transaction_size_limit() { if (m_upper_transaction_size_limit > 0) return m_upper_transaction_size_limit; diff --git a/tests/unit_tests/hardfork.cpp b/tests/unit_tests/hardfork.cpp index e29919e8f..4bfe90733 100644 --- a/tests/unit_tests/hardfork.cpp +++ b/tests/unit_tests/hardfork.cpp @@ -106,7 +106,7 @@ public: virtual void remove_spent_key(const crypto::key_image& k_image) {} virtual bool for_all_key_images(std::function<bool(const crypto::key_image&)>) const { return true; } - virtual bool for_all_blocks(std::function<bool(uint64_t, const crypto::hash&, const cryptonote::block&)>) const { return true; } + virtual bool for_blocks_range(const uint64_t&, const uint64_t&, std::function<bool(uint64_t, const crypto::hash&, const cryptonote::block&)>) const { return true; } virtual bool for_all_transactions(std::function<bool(const crypto::hash&, const cryptonote::transaction&)>) const { return true; } virtual bool for_all_outputs(std::function<bool(uint64_t amount, const crypto::hash &tx_hash, size_t tx_idx)> f) const { return true; } virtual bool is_read_only() const { return false; } |