aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2019-05-02blockchain: keep a rolling long term block weight medianmoneromooo-monero2-33/+36
2019-05-01fix wide difficulty conversion with some versions of boostmoneromooo-monero1-2/+2
2019-04-23tx_sanity_check: relax uniqueness check a bitmoneromooo-monero1-2/+2
It triggers easily on testnet
2019-04-15rpc: fix get_block_hashes.bin from wallet on pruned blockchainmoneromooo-monero2-6/+11
We want to get all blocks here, even pruned ones
2019-04-15blockchain: lock the blockchain while pruningmoneromooo-monero1-0/+4
2019-04-14blockchain_db: fix db txn ending too earlymoneromooo-monero1-29/+23
The db txn in add_block ending caused the entire overarching batch txn to stop. Also add a new guard class so a db txn can be stopped in the face of exceptions. Also use a read only db txn in init when the db itself is read only, and do not save the max tx size in that case.
2019-04-12rpc: new sanity check on relayed transactionsmoneromooo-monero3-0/+138
This will weed out some transactions with silly rings
2019-04-11functional_tests: add more blockchain related testsmoneromooo-monero4-68/+164
Related to emission, reorgs, getting tx data back, output distribution and histogram
2019-04-09blockchain: remove unused calc of short_term_constraintstoffu1-1/+0
2019-04-07core: don't check block rate nor fork time in regtest modemoneromooo-monero1-1/+4
2019-04-05cryptonote: rework block blob size sanity checkmoneromooo-monero2-8/+24
Use the actual block weight limit, assuming that weight is always greater or equal to size
2019-04-01blockchain: some debug info when adding txes-from-block failsmoneromooo-monero1-0/+2
2019-04-01Allow pruning before v10moneromooo-monero1-6/+0
This check is now not needed anymore, and would prevent people from using --prune-blockchain when starting a new sync
2019-03-30blockchain: fix returned height in create_block_templatemoneromooo-monero2-3/+6
It's now needed for CNv4, and was not retained when cached
2019-03-28blockchain: incremental long term block weight cachemoneromooo-monero1-0/+22
2019-03-28blockchain: simple cache for the long term block weightsmoneromooo-monero2-0/+24
2019-03-28Add support for V11 protocol with BulletProofV2 and short amount.cslashm1-0/+7
New scheme key destination contrfol Fix dummy decryption in debug mode
2019-03-25cryptonote: block parsing + hash calculation speedupmoneromooo-monero2-5/+8
This saves a duplicate serialization step
2019-03-25blockchain: avoid unneeded block copymoneromooo-monero1-1/+2
2019-03-25save some database calls when getting top block hash and heightmoneromooo-monero1-0/+1
2019-03-25Avoid repeated (de)serialization when syncingmoneromooo-monero1-2/+1
2019-03-25core: improve block rate monitor trigger probabilitiesmoneromooo-monero1-1/+17
The original intent of one false positive a week on average was not met, since what we really want is not the probability of having N blocks in T seconds, but either N blocks of fewer in T seconds, or N blocks or more in T seconds. Some of this could be cached since it calculates the same fairly complex floating point values, but it seems pretty fast already.
2019-03-24Make difficulty 128 bit instead of 64 bitmoneromooo-monero2-3/+7
Based on Boolberry work by: jahrsg <jahr@jahr.me> cr.zoidberg <crypto.zoidberg@gmail.com>
2019-03-21cryptonote: fix calculating coinbase tx hashmoneromooo-monero1-0/+2
Also set error flag on exception when handling new txes to keep tests working
2019-03-15blockchain: do not try to pop the genesis blockmoneromooo-monero1-0/+2
2019-03-10blockchain: fix ahead of time PoW batch calcmoneromooo-monero1-2/+2
2019-03-08blockchain: speed up getting N blocks weights/long term weightsmoneromooo-monero2-15/+24
2019-03-05Update 2019 copyrightbinaryFate10-10/+10
2019-03-05cryptonote: avoid double parsing blocks when syncingmoneromooo-monero2-12/+14
2019-03-05core: avoid double parsing blocks after hohmoneromooo-monero4-16/+23
2019-03-05blockchain: avoid unneeded block copymoneromooo-monero1-1/+2
2019-03-05save some database calls when getting top block hash and heightmoneromooo-monero1-25/+35
2019-03-05blockchain: avoid pointless transaction copy and temporarymoneromooo-monero1-3/+4
2019-03-05blockchain: avoid duplicate block hash computationmoneromooo-monero1-2/+1
2019-03-05core: avoid calculating tx prefix hash when we don't need itmoneromooo-monero2-20/+17
2019-03-05Avoid repeated (de)serialization when syncingmoneromooo-monero4-13/+19
2019-03-05fix merge errors, update recommended version to 0.14.0.2Riccardo Spagni1-1/+1
2019-03-05update checkpoints hashRiccardo Spagni1-2/+2
2019-03-04various: remove unused variablesmoneromooo-monero1-2/+0
2019-03-04blockchain: forbid older BP rct versions from v11moneromooo-monero1-1/+18
2019-03-04blockchain: add v10 fork heightsmoneromooo-monero1-0/+5
2019-03-04Print the reason why a notification spec failed to parsemoneromooo-monero1-2/+2
2019-03-04blockchain: include number of discarded blocks in --reorg-notifymoneromooo-monero2-3/+5
2019-03-04core: add a few more block rate window sizesmoneromooo-monero1-1/+1
The 10 minute one will never trigger for 0 blocks, as it's still fairly likely to happen even without the actual hash rate changing much, so we add a 20 minute window, where it will (for 0 blocks) and a one hour window.
2019-03-04core: add --block-rate-notifymoneromooo-monero2-0/+33
This runs a command whenever the block rate deviates too much from the expectation
2019-03-04ArticMine's new block weight algorithmmoneromooo-monero4-24/+137
This curbs runaway growth while still allowing substantial spikes in block weight Original specification from ArticMine: here is the scaling proposal Define: LongTermBlockWeight Before fork: LongTermBlockWeight = BlockWeight At or after fork: LongTermBlockWeight = min(BlockWeight, 1.4*LongTermEffectiveMedianBlockWeight) Note: To avoid possible consensus issues over rounding the LongTermBlockWeight for a given block should be calculated to the nearest byte, and stored as a integer in the block itself. The stored LongTermBlockWeight is then used for future calculations of the LongTermEffectiveMedianBlockWeight and not recalculated each time. Define: LongTermEffectiveMedianBlockWeight LongTermEffectiveMedianBlockWeight = max(300000, MedianOverPrevious100000Blocks(LongTermBlockWeight)) Change Definition of EffectiveMedianBlockWeight From (current definition) EffectiveMedianBlockWeight = max(300000, MedianOverPrevious100Blocks(BlockWeight)) To (proposed definition) EffectiveMedianBlockWeight = min(max(300000, MedianOverPrevious100Blocks(BlockWeight)), 50*LongTermEffectiveMedianBlockWeight) Notes: 1) There are no other changes to the existing penalty formula, median calculation, fees etc. 2) There is the requirement to store the LongTermBlockWeight of a block unencrypted in the block itself. This is to avoid possible consensus issues over rounding and also to prevent the calculations from becoming unwieldy as we move away from the fork. 3) When the EffectiveMedianBlockWeight cap is reached it is still possible to mine blocks up to 2x the EffectiveMedianBlockWeight by paying the corresponding penalty. Note: the long term block weight is stored in the database, but not in the actual block itself, since it requires recalculating anyway for verification.
2019-02-08New scheme key destination contrfolcslashm2-41/+10
Implies protocol version management.
2019-02-01cryptonote: Fix enum check in expand_transaction_2Tom Smeding1-1/+1
This was noticed because GCC warned about using an enum value in a boolean context.
2019-02-01cryptonote: Add const-qualifier on comparison functorTom Smeding1-1/+1
The original code did not compile with GCC 8.2.1 in C++17 mode, since comparison functions for std::set's must be invocable as const.
2019-01-28blockchain: add --reorg-notifymoneromooo-monero3-1/+32
This will trigger if a reorg is seen. This may be used to do things like stop automated withdrawals on large reorgs. %s is replaced by the height at the split point %h is replaced by the height of the new chain %n is replaced by the number of new blocks after the reorg
2019-01-28notify: handle arbitrary tagsmoneromooo-monero1-1/+1
2019-01-26blockchain: fix default genesis block timestampmoneromooo-monero1-2/+2
2019-01-22add a bulletproof version, new bulletproof type, and rct configmoneromooo-monero4-12/+26
This makes it easier to modify the bulletproof format
2019-01-22Pruningmoneromooo-monero4-3/+185
The blockchain prunes seven eighths of prunable tx data. This saves about two thirds of the blockchain size, while keeping the node useful as a sync source for an eighth of the blockchain. No other data is currently pruned. There are three ways to prune a blockchain: - run monerod with --prune-blockchain - run "prune_blockchain" in the monerod console - run the monero-blockchain-prune utility The first two will prune in place. Due to how LMDB works, this will not reduce the blockchain size on disk. Instead, it will mark parts of the file as free, so that future data will use that free space, causing the file to not grow until free space grows scarce. The third way will create a second database, a pruned copy of the original one. Since this is a new file, this one will be smaller than the original one. Once the database is pruned, it will stay pruned as it syncs. That is, there is no need to use --prune-blockchain again, etc.
2019-01-18core: include a dummy encrypted payment id when no payment is usedmoneromooo-monero1-6/+40
For better transaction uniformity, even though this wastes space.
2019-01-18core, wallet: remember original text version of destination addressmoneromooo-monero1-3/+15
2019-01-18crptonote_core: do not error out sending unparsable extra fieldmoneromooo-monero1-2/+2
extra is arbitrary, and the user may well want to send custom data
2019-01-07blockchain: don't propagate exception past dtormoneromooo-monero1-1/+2
Coverity 190660
2019-01-01blockchain: fix wrong hf version when popping multiple blocksmoneromooo-monero1-6/+4
Since we keep track of the hf version in the db, we pick it up from there instead of doing the full reorg call, which is quite expensive
2019-01-01blockchain: use the version passed as parameter, not a new onemoneromooo-monero1-1/+1
2018-12-25cryptonote_core: revert extra_tx_mapmoneromooo-monero2-59/+5
While the lookups are faster, the zeroCommit calls have to be done again when storing the new outputs in the db, which ends up making the whole thing slower after all, and the ways this can be cached aren't very nice code wise, so let's forget it since the gains aren't very large anyway.
2018-12-18blockchain: fix block rate check for empty blockchainsmoneromooo-monero1-1/+3
2018-12-18blockchain_db: speedup tx output gatheringmoneromooo-monero4-8/+25
We know all the data we'll want for getblocks.bin is contiguous
2018-12-05tx_pool: add a few std::move where it can make a differencemoneromooo-monero1-3/+4
2018-12-05cryptonote: set tx hash on newly parsed txes when knownmoneromooo-monero1-5/+11
2018-12-05blockchain: call deinit in dtormoneromooo-monero2-7/+15
This ensures the io service that runs in another thread cannot access data after it's deleted
2018-12-04move int-util.h to epeemoneromooo-monero2-2/+2
2018-12-02blockchain: fix race between two external mining threadsmoneromooo-monero1-5/+3
2018-11-30daemon: stop miner before we bring the whole thing downmoneromooo-monero1-0/+1
This avoids the miner erroring out trying to submit blocks to a core that's already shut down (and avoids pegging the CPU while we're busy shutting down).
2018-11-28add command pop_blocksJason Wong2-0/+39
add new public method to Blockchain and update according to code review update after review: better lock/unlock, try catch and coding style
2018-11-27blockchain: avoid unnecessary DB lookups when syncingmoneromooo-monero2-35/+86
Some of the inputs for block in a span will be from other earlier blocks in that span. Keep track of those outputs so we don't have to look them up again after those early blocks are added to the blockchain.
2018-11-26core: fix adding new pre-hoh block when a tx is already in the poolmoneromooo-monero1-5/+4
2018-11-26rpc: speedup get_outs.binmoneromooo-monero1-8/+26
2018-11-23remove some unused codemoneromooo-monero2-8/+3
Found by codacy.com
2018-11-23a few minor (but easy) performance tweaksmoneromooo-monero3-9/+9
Found by codacy.com
2018-11-19Avoid unnecessary temp block and copy ctormoneromooo-monero1-1/+1
block already has a default ctor, and the extra object churn due to its innards (vectors, etc) is pointless.
2018-11-16tests: add unit tests for get_output_distributionmoneromooo-monero1-0/+1
2018-11-16blockchain: remove "0 is height" shortcut from get_output_distributionmoneromooo-monero1-2/+0
This prevents asking for just 0, and the RPC layer already does this
2018-11-16Revert "blockchain: simplify output distribution code"moneromooo-monero1-2/+7
This reverts commit b2bb9312a75781e714acf3c406634b3d4cded418.
2018-11-15Removed a lot of unnecessary includesMartijn Otto2-4/+0
2018-11-06protocol: option to pad transaction relay to the next kBmoneromooo-monero2-1/+17
To help protect one's privacy from traffic volume analysis for people using Tor or I2P. This will really fly once we relay txes on a timer rather than on demand, though. Off by default for now since it's wasteful and doesn't bring anything until I2P's in.
2018-11-05blockchain: fix innocuous difficulty cache inconsistencymoneromooo-monero1-0/+1
This inconsistent state would not actually be used in practice
2018-11-05blockchain: use uint64_t for block height, not size_tmoneromooo-monero1-1/+1
for consistency
2018-11-05cryptonote_core: avoid gratuitous recalculations in check_block_rate()xiphon1-1/+2
2018-11-04blockchain: remove unused output_scan_worker parametermoneromooo-monero2-10/+5
2018-11-04blockchain: don't run threads if we have just one function to runmoneromooo-monero1-1/+1
2018-11-01cryptonote_core: fix build error gcc 5.4.0 'sign-compare'xiphon1-1/+1
2018-11-01tx_pool: speed up take_tx for transactions from blocksmoneromooo-monero2-1/+14
This happens for every historical tx when syncing, and the unnecessary parsing is actually showing up on profile. Since these are kept cached for just one block, this does not increase memory usage after syncing.
2018-11-01tx_pool: remove unnecessary get_transaction_hashmoneromooo-monero1-4/+3
2018-11-01core: avoid unnecessary tx/blob conversionsmoneromooo-monero6-14/+17
2018-10-31tx_pool: allow take_tx to work without m_txs_by_fee_and_receive_timemoneromooo-monero1-3/+2
This should make it possible to have two daemons running on the same database again.
2018-10-31tx_pool: fix comment about transaction_prefixmoneromooo-monero1-1/+1
It was leftover from a change that was undone before commit, but the comment change was let through
2018-10-27core: fix unmixable special case allowing ring size below 11moneromooo-monero1-1/+1
2018-10-23Fix prune using receive time as tx_weightdoy-lee1-3/+3
2018-10-22blocks: use auto-generated .c files instead of 'LD -r -b binary'xiphon5-27/+34
2018-10-21core: fix handle_incoming_tx* comment about return valuemoneromooo-monero1-2/+2
2018-10-19blockchain: move two new verification errors to the verify categorymoneromooo-monero1-2/+2
Lest we get people get scared again
2018-10-18tx_pool: revert #4592 and move bin2hex conversion to on_get_transaction_poolstoffu1-1/+1
2018-10-17core: don't verify range proofs multiple timesmoneromooo-monero1-1/+6
2018-10-15tx_pool: store hex string instead of raw binary to tx_blob of ↵stoffu1-1/+1
get_transaction_pool RPC Inspired by https://github.com/masari-project/masari/issues/93
2018-10-08Revert "Merge pull request #4472"Riccardo Spagni5-34/+27
This reverts commit 79d46c4d551a9b1261801960095bf4d24967211a, reversing changes made to c9fc61dbb56cca442c775faa2554a7460879b637.
2018-10-08blockchain: add check test options are given for fakechain modemoneromooo-monero1-0/+3
Coverity 188616
2018-10-08tx_pool: avoid parsing a whole tx if only the prefix is neededmoneromooo-monero2-32/+32
2018-10-07cryptonote: sort tx_extra fieldsmoneromooo-monero1-0/+6
This removes some small amount of fingerprinting entropy. There is no consensus rule to require this since this field is technically free form, and a transaction is free to have custom data in it.
2018-10-04blocks: use auto-generated .c files instead of 'LD -r -b binary'xiphon5-27/+34
2018-09-30build: fix gcc false positive 'stringop-overflow' warningxiphon1-1/+1
2018-09-29Merge pull request #4333Riccardo Spagni3-0/+33
73403004 add --block-notify to monerod and --tx-notify to monero-wallet-{cli,rpc} (moneromooo-monero)
2018-09-29daemon: silence daemon update warnings on testnetiDunk54001-2/+2
2018-09-25tx_pool: fix tx removal at startup keeping referencesmoneromooo-monero1-0/+1
2018-09-24blockchain: add stagenet v8 and v9, two weeks before mainnetmoneromooo-monero1-0/+2
2018-09-23update checkpoints.datRiccardo Spagni1-1/+1
2018-09-20cryptonote_core: warn when the block rate deviates from expectationsmoneromooo-monero4-0/+69
The warning threshold is set to allow a false positive every ten days on average.
2018-09-14remove obsolete daemon selection of fake outs and old tx constructionmoneromooo-monero4-328/+0
2018-09-14rpc: add a "is an update available" flag in get_infomoneromooo-monero2-1/+18
Make it easier for a user to be told when to update
2018-09-13tx_pool: make the max tx size a consensus rule from v8moneromooo-monero1-1/+1
2018-09-12blockchain: simplify output distribution codemoneromooo-monero1-7/+2
2018-09-11blockchain: add a testnet v9 a day after v8moneromooo-monero1-0/+1
So that bulletproofs become mandatory
2018-09-11v8: per byte fee, pad bulletproofs, fixed 11 ring sizemoneromooo-monero8-327/+356
2018-09-11require canonical multi output bulletproof layoutmoneromooo-monero1-0/+29
2018-09-11Bulletproof aggregated verification and testsmoneromooo-monero4-51/+149
Also constrains bulletproofs to simple rct, for simplicity
2018-09-11bulletproofs: add aggregated verificationmoneromooo-monero2-2/+2
Ported from sarang's java code
2018-09-11bulletproofs: add multi output bulletproofs to rctmoneromooo-monero3-8/+24
2018-09-02blockchain: add mainnet v8 height targetting 18 octobermoneromooo-monero1-0/+6
and v9 a day later
2018-08-19tx_pool: fix infinite loop when failing to find a meta recordmoneromooo-monero1-7/+1
2018-08-16Do memwipe for critical secret keys copied to rct::keystoffu1-0/+3
2018-08-16core: cache block template where possiblemoneromooo-monero4-2/+94
This avoids constant rechecking of the same things each time a miner asks for the block template. The tx pool maintains a cookie to allow users to detect when the pool state changed, which means the block template needs rebuilding.
2018-08-12core: sync database based on bytes added, not blocks addedmoneromooo-monero3-14/+35
Blocks have a very wide range, whereas actual size is the relevant quantity to consider when syncing
2018-08-09blockchain: use uint64_t for height, not size_tmoneromooo-monero1-1/+1
2018-07-21blockchain: some batch tx scanning speedupmoneromooo-monero1-15/+19
2018-07-13db: store cumulative rct output distribution in the db for speedmoneromooo-monero1-5/+34
This gets rid of the temporary precalc cache. Also make the RPC able to send data back in binary or JSON, since there can be a lot of data This bumps the LMDB database format to v3, with migration.
2018-07-07blockchain: cache next block difficulty after adding a blockmoneromooo-monero1-0/+1
It's not 100% certain it'll be needed, but it avoids getinfo needing the blockchain lock and potentially blocking
2018-06-29blockchain: fix getting invalid block data on failuremoneromooo-monero1-1/+2
2018-06-29add --regtest and --fixed-difficulty for regression testingvictorsintnicolaas4-4/+87
on_generateblocks RPC call combines functionality from the on_getblocktemplate and on_submitblock RPC calls to allow rapid block creation. Difficulty is set permanently to 1 for regtest. Makes use of FAKECHAIN network type, but takes hard fork heights from mainchain Default reserve_size in generate_blocks RPC call is now 1. If it is 0, the following error occurs 'Failed to calculate offset for'. Queries hard fork heights info of other network types
2018-06-28blockchain: set the m_verifivation_failed flag in a couple more placesmoneromooo-monero1-0/+2
when a block being added to the main chain is invalid. This ensures the peer is banned after a number of these.
2018-06-28blockchain: fix build after waiter::wait prototype changemoneromooo-monero1-1/+1
2018-06-26threadpool: allow leaf functions to run concurrentlymoneromooo-monero2-8/+8
Decrease the number of worker threads by one to account for the fact the calling thread acts as a worker thread now
2018-06-26blockchain: simplify/speedup handle_get_objectsmoneromooo-monero1-13/+8
2018-06-26rpc: rework to avoid repeated calculations in get_blocks.binmoneromooo-monero4-10/+19
2018-06-26replace std::list with std::vector on some hot pathsmoneromooo-monero6-76/+108
also use reserve where appropriate
2018-06-26alt_chain_info can now give more info about a particular alt chainmoneromooo-monero2-6/+7
2018-06-24tx_pool: cache check_tx_inputs resultsmoneromooo-monero2-6/+35
This is called a lot when creating a block template, and does not change until the blockchain changes. This also avoids tx parsing when cached.
2018-06-11Remove old logic saved in comments.Jean Pierre Dudey1-2/+2
Signed-off-by: Jean Pierre Dudey <jeandudey@hotmail.com>
2018-06-11cryptonote_config: add get_config to refactor x = testnet ? ↵stoffu1-12/+1
config::testnet::X : stagenet ? config::stagenet::X : config::X
2018-06-09blockchain: avoid duplicate db query for heightmoneromooo-monero1-1/+1
2018-06-06blockchain: fix deadlock with the difficulty cachemoneromooo-monero1-8/+12
2018-06-05tx_pool: initialize bitflags padding since it gets written to storagemoneromooo-monero1-0/+2
Avoids valgrind reporting uninitialized data usage
2018-06-04blockchain: pop forked blocks only when DB is not read-onlystoffu1-1/+1
2018-06-02blockchain: demote a hash-of-hashes validation warning to debugmoneromooo-monero1-1/+1
This data comes from untrusted peers, and validation failures are therefore normal.
2018-06-02update checkpoints.dat for point releaseRiccardo Spagni1-1/+1
2018-06-02tx_pool: hold off parsing a tx blob till we actually need itmoneromooo-monero2-12/+35
2018-06-01blockchain: return error when requesting non existent outputmoneromooo-monero1-6/+13
avoids RPC thread dying, causing the wallet to timeout
2018-05-28core: fix automatic safe db sync mode switchingmoneromooo-monero1-5/+6
2018-05-28tx_pool: remove old comment from fill_block_template()stoffu1-4/+0
2018-05-23db_lmdb: save pruned and prunable tx data separatelymoneromooo-monero4-12/+18
This bumps DB version to 2, migration code will run for v1 DBs
2018-05-23update checkpointsRiccardo Spagni1-1/+1
2018-05-21speed up get_output_distribution (and precalc common case)moneromooo-monero4-22/+8
2018-05-20core: remove threadpool dependency from headermoneromooo-monero2-6/+3
2018-05-20Fix output shuffling for multisigstoffu2-9/+11
2018-05-18core: lock incoming tx lock when checking the txpool and chainmoneromooo-monero1-0/+1
This gets rid of an innocuous race trying to add the same tx twice to the txpool
2018-05-13Use median timestamp if current time renders a block invalid.Thaer Khawaja2-6/+15
2018-05-09blockchain: avoid exception if asked for a block we do not havemoneromooo-monero1-8/+11
This can happen if a peer tries to obtain the next span from other peers if that span is needed for not downloaded yet. Also if the peer maliciously requests a non existent block hash.
2018-05-09blockchain: invalidate misc caches when popping blocksmoneromooo-monero1-0/+6
Might be a bit heavy handed, but conservative.
2018-05-07cryptonote: make sure outPk setup always happensmoneromooo-monero1-33/+0
2018-05-06blockchain: pop top if block version disagrees with the ideal fork versionstoffu1-0/+47
2018-04-29Ensure m_timestamps has the correct number for computing difficulty.Thaer Khawaja1-1/+1
2018-04-23blockchain: log in DEBUG when a block is found, and wheremoneromooo-monero1-3/+3
Eases up debugging
2018-04-23speedup get_output_histogram for all amounts when min_count > 0moneromooo-monero2-3/+4
This skips the vast majority of "dust" output amounts with just one instance on the chain. Clocks in at 0.15% of the original time on testnet.
2018-04-22Only log an error if fork version is higher AND is not known.Thaer Khawaja2-0/+12
2018-04-11tx_pool: fix loading with colliding key imagesmoneromooo-monero1-17/+26
A key image may be present more than once if all but one of the txes spending that key image are coming from blocks. When loading a txpool from storage, we must load the one that's not from a block first to avoid rejection
2018-03-31cryptonote_tx_util: make destinations properly shuffledstoffu1-2/+3
2018-03-30blockchain: add scope guard to waiter for threaded txv1 verificationstoffu1-0/+1
2018-03-27fix lambda compile error on openbsdmoneromooo-monero1-1/+1
2018-03-24update block hashes for checkpoints.datRiccardo Spagni1-1/+1
2018-03-21core: add get_earliest_ideal_height_for_version()stoffu3-0/+19
2018-03-19blockchain: cache difficulty for next blockmoneromooo-monero2-3/+22
Takes about 10 ms, which takes pretty much all of the get_info RPC, which is called pretty often from wallets. Also add a new lock so we don't need to lock the blockchain lock, which will avoid blocking for a long time when calling the getinfo RPC while syncing. Users of get_difficulty_for_next_block who need the lock will have locked it already.
2018-03-18core: fix use of uninitialised datamoneromooo-monero1-1/+2
2018-03-18Move v7 fork to 1546000 to give more update timemoneromooo-monero1-2/+2
2018-03-16blockchain: forbid bulletproof types before v8moneromooo-monero1-1/+2
They were already forbidden implicitely, but let's make that explicit for robustness
2018-03-16add RPC to get a histogram of outputs of a given amountmoneromooo-monero4-2/+78
2018-03-16blockchain: fix log message about per-kB feestoffu1-1/+1
2018-03-15Fix typos in various filesDimitris Apostolou3-6/+6
2018-03-14Remove the `Blockchain::get_all_known_block_ids` function.Jean Pierre Dudey2-28/+0
This function isn't used in the codebase. Signed-off-by: Jean Pierre Dudey <jeandudey@hotmail.com>
2018-03-14keypair::generate: always require hw::device to avoid possible mistakestoffu1-1/+1
2018-03-14device: untangle cyclic depenencystoffu1-10/+9
When #3303 was merged, a cyclic dependency chain was generated: libdevice <- libcncrypto <- libringct <- libdevice This was because libdevice needs access to a set of basic crypto operations implemented in libringct such as scalarmultBase(), while libringct also needs access to abstracted crypto operations implemented in libdevice such as ecdhEncode(). To untangle this cyclic dependency chain, this patch splits libringct into libringct_basic and libringct, where the basic crypto ops previously in libringct are moved into libringct_basic. The cyclic dependency is now resolved thanks to this separation: libcncrypto <- libringct_basic <- libdevice <- libcryptonote_basic <- libringct This eliminates the need for crypto_device.cpp and rctOps_device.cpp. Also, many abstracted interfaces of hw::device such as encrypt_payment_id() and get_subaddress_secret_key() were previously implemented in libcryptonote_basic (cryptonote_format_utils.cpp) and were then called from hw::core::device_default, which is odd because libdevice is supposed to be independent of libcryptonote_basic. Therefore, those functions were moved to device_default.cpp.
2018-03-12Ledger HW Bug fixesCédric1-1/+1
Fix the way the REAL mode is handle: Let create_transactions_2 and create_transactions_from construct the vector of transactions. Then iterate on it and resign. We just need to add 'outs' list in the TX struct for that. Fix default secret keys value when DEBUG_HWDEVICE mode is off The magic value (00...00 for view key and FF..FF for spend key) was not correctly set when DEBUG_HWDEVICE was off. Both was set to 00...00. Add sub-address info in ABP map in order to correctly display destination sub-address on device Fix DEBUG_HWDEVICE mode: - Fix compilation errors. - Fix control device init in ledger device. - Add more log. Fix sub addr control Fix debug Info
2018-03-09Stagenet: successive forks up to v7stoffu1-0/+8
2018-03-07core: add v7 for 1539500 on mainnetmoneromooo-monero1-0/+3
2018-03-07Bump min ring size from 5 to 7 from v7moneromooo-monero1-1/+1
2018-03-05Correct spelling mistakes.Edward Betts1-2/+2
2018-03-05Stagenetstoffu4-46/+79
2018-03-05Use `genesis_tx` parameter in `generate_genesis_block`. #3261Jean Pierre Dudey1-10/+1
* src/cryptnote_config.h: The constant `config::testnet::GENESIS_TX` was changed to be the same as `config::GENESIS_TX` (the mainnet's transaction) because the mainnet's transaction was being used for both networks. * src/cryptonote_core/cryptonote_tx_utils.cpp: The `generate_genesis_block` function was ignoring the `genesis_tx` parameter, and instead it was using the `config::GENESIS_TX` constant. That's why the testnet genesis transaction was changed. Also five lines of unused code were removed. Signed-off-by: Jean Pierre Dudey <jeandudey@hotmail.com>
2018-03-04Code modifications to integrate Ledger HW device into monero-wallet-cli.cslashm2-16/+24
The basic approach it to delegate all sensitive data (master key, secret ephemeral key, key derivation, ....) and related operations to the device. As device has low memory, it does not keep itself the values (except for view/spend keys) but once computed there are encrypted (with AES are equivalent) and return back to monero-wallet-cli. When they need to be manipulated by the device, they are decrypted on receive. Moreover, using the client for storing the value in encrypted form limits the modification in the client code. Those values are transfered from one C-structure to another one as previously. The code modification has been done with the wishes to be open to any other hardware wallet. To achieve that a C++ class hw::Device has been introduced. Two initial implementations are provided: the "default", which remaps all calls to initial Monero code, and the "Ledger", which delegates all calls to Ledger device.
2018-03-02core: fix sending to the source address with a short payment idmoneromooo-monero1-0/+2
It would fail to send, thinking it needs a destination address, since the destination matches the change address in this case.
2018-02-23blockchain: fix random sync failuresmoneromooo-monero1-1/+4
When a block is added as part of a chunk (when syncing historical blocks), a block may end up already in the blockchain if it was added to the queue before being added to the chain (though it's not clear how that could happen, but it's an implementation detail) and thus may not be added to the chain when add_block is called. This would cause m_blocks_txs_check to not be cleared, causing it to get out of sync at next call, and thus wrongfully reject the next block.
2018-02-18cryptonote_core: change wording of fork warning messagemoneromooo-monero1-1/+1
An udpate may or may not be available now, but should be soon if not. This will prevent too many people freaking out.
2018-02-16options: add testnet option dependencieswhythat1-2/+6
2018-02-16options: remove testnet-* optionswhythat2-14/+10
2018-02-16txpool: Don't bail out when blob_size == tx_size_limitLeon Klingele1-2/+2
Previously, when blob_size == tx_size_limit, the "m_too_big" property was set and the transaction was rejected. This should not have been the case.
2018-02-16core: add --no-fluffy-blocks, and enable fluffy blocks by defaultmoneromooo-monero1-2/+10
2018-02-14Use `genesis_tx` parameter in `generate_genesis_block`.Jean Pierre Dudey1-10/+1
* src/cryptnote_config.h: The constant `config::testnet::GENESIS_TX` was changed to be the same as `config::GENESIS_TX` (the mainnet's transaction) because the mainnet's transaction was being used for both networks. * src/cryptonote_core/cryptonote_tx_utils.cpp: The `generate_genesis_block` function was ignoring the `genesis_tx` parameter, and instead it was using the `config::GENESIS_TX` constant. That's why the testnet genesis transaction was changed. Also five lines of unused code were removed. Signed-off-by: Jean Pierre Dudey <jeandudey@hotmail.com>