Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upstream merge 3 #90

Merged
merged 39 commits into from
Feb 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
ac32dcb
wallet2: fix out of sync account tag cache /monero#4004
moneromooo-monero Jun 15, 2018
5ed3f4b
Fix RPC crashes that didn't check for an open wallet /monero#4005
hyc Jun 15, 2018
fa18f97
zmq_server: fix bind call when address and/or port are empty /monero#…
moneromooo-monero Jun 17, 2018
51e0a84
wallet2: fix double header in unsigned transfer file /monero#4028
moneromooo-monero Jun 19, 2018
5c213c7
wallet-rpc.getaddress: throw if index is out of bound /monero#4035
stoffu Jun 21, 2018
484e78d
wallet2: fix read buffer overflow in import_key_images /monero#4041
moneromooo-monero Jun 23, 2018
ef75beb
simplewallet: init trusted daemon flag to false when autodetecting /m…
moneromooo-monero Jun 23, 2018
87bf035
device_ledger: fix potential buffer overflow from bad size calc /mone…
moneromooo-monero Jun 23, 2018
eda3ac1
device: misc cleanup /monero#4043
moneromooo-monero Jun 23, 2018
3558a92
device_ledger: fix buffer underflow on bad data from device /monero#4043
moneromooo-monero Jun 23, 2018
ea63e2d
unit_tests: add device unit tests /monero#3617
moneromooo-monero Apr 12, 2018
9a7c018
db_lmdb: enable batch transactions by default /monero#3854
stoffu Jun 14, 2018
133bcb3
add --regtest and --fixed-difficulty for regression testing /monero#3854
vicsn Jun 14, 2018
41dd0e1
update get_info RPC and bump RPC version /monero#3854
vicsn Jun 13, 2018
1612856
first new functional tests /monero#3854
vicsn Jun 15, 2018
8a66e2b
alt_chain_info can now give more info about a particular alt chain /m…
moneromooo-monero May 19, 2018
56f3046
db: store cumulative rct output distribution in the db for speed /mon…
moneromooo-monero May 22, 2018
e418bad
rpc: add blockchain disk size to getinfo /monero#4013
moneromooo-monero Jun 17, 2018
f26a722
crypto: add a README pointing to the SUPERCOP licence /monero#4021
moneromooo-monero Jun 18, 2018
0c429bb
simplewallet: remove leftover global debug trace /monero#4023
moneromooo-monero Jun 18, 2018
508ab19
daemon: show a bit more info with print_block /monero#4029
stoffu Jun 20, 2018
287ce15
miner: show id and height when a block is found /monero#4030
stoffu Jun 20, 2018
796ad59
device_ledger: factor the prologue code /monero#4032
moneromooo-monero Jun 20, 2018
1e34f9b
rpc: add a non binary get_transaction_pool_hashes RPC /monero#4033
moneromooo-monero Jun 20, 2018
1fb67f9
tx_pool: cache check_tx_inputs results /monero#4047
moneromooo-monero Jun 24, 2018
321ab23
unit_tests: do not recreate the same base rct sig all the time /moner…
moneromooo-monero Jun 27, 2018
c902e77
simplewallet.sweep_all: show usage when parsing fails /monero#4062
stoffu Jun 27, 2018
b984591
blockchain_utilities: report file offset where a read error occurs /m…
moneromooo-monero Jun 27, 2018
ecca780
remove epee from link lines where it's redundant /monero#4075
moneromooo-monero Jun 28, 2018
ff9e36b
blockchain: set the m_verifivation_failed flag in a couple more place…
moneromooo-monero Jun 27, 2018
39e2f0c
blockchain: fix getting invalid block data on failure /monero#4081
moneromooo-monero Jun 29, 2018
7b29e0b
wallet2: recover from index out of hashchain bounds error /monero#4087
moneromooo-monero Apr 28, 2018
86f5d42
node_rpc_proxy: factor a few RPC calls using get_info /monero#4088
moneromooo-monero Jun 30, 2018
edf0792
monero-wallet-cli: added locked_sweep_all command /monero#3629
Apr 13, 2018
b0a9ac0
crypto: remove slight bias in key generation due to modulo /monero#4097
moneromooo-monero Jul 4, 2018
1e85021
wallet: warn when payment IDs are used /monero#4109
moneromooo-monero Jul 6, 2018
4cff60e
core_tests: add --filter to select which tests to run /monero#4110
moneromooo-monero Jul 6, 2018
8e16f53
memwipe: don't call the workhorse for 0 bytes /monero#4126
moneromooo-monero Jul 10, 2018
721ad17
db_lmdb: don't sync a read only DB /monero#4129
moneromooo-monero Jul 11, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions contrib/epee/src/memwipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

void *memwipe(void *ptr, size_t n)
{
if (memset_s(ptr, n, 0, n))
if (n > 0 && memset_s(ptr, n, 0, n))
{
#ifdef NDEBUG
fprintf(stderr, "Error: memset_s failed\n");
Expand All @@ -67,7 +67,8 @@ void *memwipe(void *ptr, size_t n)

void *memwipe(void *ptr, size_t n)
{
explicit_bzero(ptr, n);
if (n > 0)
explicit_bzero(ptr, n);
SCARECROW
return ptr;
}
Expand Down Expand Up @@ -105,7 +106,8 @@ static void memory_cleanse(void *ptr, size_t len)

void *memwipe(void *ptr, size_t n)
{
memory_cleanse(ptr, n);
if (n > 0)
memory_cleanse(ptr, n);
SCARECROW
return ptr;
}
Expand Down
5 changes: 5 additions & 0 deletions src/blockchain_db/berkeleydb/db_bdb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1213,6 +1213,11 @@ std::vector<std::string> BlockchainBDB::get_filenames() const
return full_paths;
}

bool BlockchainBDB::remove_data_file(const std::string& folder)
{
return true;
}

std::string BlockchainBDB::get_db_name() const
{
LOG_PRINT_L3("BlockchainBDB::" << __func__);
Expand Down
2 changes: 2 additions & 0 deletions src/blockchain_db/berkeleydb/db_bdb.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,8 @@ class BlockchainBDB : public BlockchainDB

virtual std::vector<std::string> get_filenames() const;

virtual bool remove_data_file(const std::string& folder);

virtual std::string get_db_name() const;

virtual bool lock();
Expand Down
11 changes: 10 additions & 1 deletion src/blockchain_db/blockchain_db.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,21 +218,30 @@ uint64_t BlockchainDB::add_block( const block& blk
// call out to add the transactions

time1 = epee::misc_utils::get_tick_count();

uint64_t num_rct_outs = 0;
add_transaction(blk_hash, blk.miner_tx);
if (blk.miner_tx.version == 2)
num_rct_outs += blk.miner_tx.vout.size();
int tx_i = 0;
crypto::hash tx_hash = crypto::null_hash;
for (const transaction& tx : txs)
{
tx_hash = blk.tx_hashes[tx_i];
add_transaction(blk_hash, tx, &tx_hash);
for (const auto &vout: tx.vout)
{
if (vout.amount == 0)
++num_rct_outs;
}
++tx_i;
}
TIME_MEASURE_FINISH(time1);
time_add_transaction += time1;

// call out to subclass implementation to add the block & metadata
time1 = epee::misc_utils::get_tick_count();
add_block(blk, block_size, cumulative_difficulty, coins_generated, blk_hash);
add_block(blk, block_size, cumulative_difficulty, coins_generated, num_rct_outs, blk_hash);
TIME_MEASURE_FINISH(time1);
time_add_block1 += time1;

Expand Down
36 changes: 36 additions & 0 deletions src/blockchain_db/blockchain_db.h
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ class BlockchainDB
, const size_t& block_size
, const difficulty_type& cumulative_difficulty
, const uint64_t& coins_generated
, uint64_t num_rct_outs
, const crypto::hash& blk_hash
) = 0;

Expand Down Expand Up @@ -655,6 +656,20 @@ class BlockchainDB
*/
virtual std::vector<std::string> get_filenames() const = 0;

/**
* @brief remove file(s) storing the database
*
* This function is for resetting the database (for core tests, functional tests, etc).
* The function reset() is not usable because it needs to open the database file first
* which can fail if the existing database file is in an incompatible format.
* As such, this function needs to be called before calling open().
*
* @param folder The path of the folder containing the database file(s) which must not end with slash '/'.
*
* @return true if the operation is succesfull
*/
virtual bool remove_data_file(const std::string& folder) const = 0;

// return the name of the folder the db's file(s) should reside in
/**
* @brief gets the name of the folder the BlockchainDB's file(s) should be in
Expand Down Expand Up @@ -891,6 +906,20 @@ class BlockchainDB
*/
virtual uint64_t get_block_timestamp(const uint64_t& height) const = 0;

/**
* @brief fetch a block's cumulative number of rct outputs
*
* The subclass should return the numer of rct outputs in the blockchain
* up to the block with the given height (inclusive).
*
* If the block does not exist, the subclass should throw BLOCK_DNE
*
* @param height the height requested
*
* @return the cumulative number of rct outputs
*/
virtual std::vector<uint64_t> get_block_cumulative_rct_outputs(const std::vector<uint64_t> &heights) const = 0;

/**
* @brief fetch the top block's timestamp
*
Expand Down Expand Up @@ -1536,6 +1565,13 @@ class BlockchainDB
*/
virtual bool is_read_only() const = 0;

/**
* @brief get disk space requirements
*
* @return the size required
*/
virtual uint64_t get_database_size() const = 0;

// TODO: this should perhaps be (or call) a series of functions which
// progressively update through version updates
/**
Expand Down
Loading