Commit Graph

512 Commits

Author SHA1 Message Date
moneromooo-monero
ada527558f
Use the supplied hard fork version in validate_miner_transaction
rather than using the current one. No functional changes, but may
save some bugs in the future.
2016-08-28 21:28:51 +01:00
moneromooo-monero
dc4aad7eb5
add rct to the protocol
It is not yet constrained to a fork, so don't use on the real network
or you'll be orphaned or rejected.
2016-08-28 21:28:37 +01:00
moneromooo-monero
cc7f449d57
make rct tx serialization work
It may be suboptimal, but it's a pain to have to rebuild everything
when some of this changes.
Also, no clue why there seems to be two different code paths for
serializing a tx...
2016-08-28 21:28:31 +01:00
moneromooo-monero
98564439f8
core: link against libringct 2016-08-28 21:28:18 +01:00
moneromooo-monero
4258dab4d6
core: new /getrandom_rctouts.bin binary RPC call
to get random ringct outputs to mix with
2016-08-28 21:28:16 +01:00
moneromooo-monero
9e82b694da
remove original Cryptonote blockchain_storage blockchain format 2016-08-28 21:27:32 +01:00
Howard Chu
dc411ea3b7 Change default db-sync-mode to fast, not fastest 2016-08-28 16:20:22 +01:00
Thomas Winget
78035d2b6c
Fix fake 'network synchronized, begin using' messages 2016-08-23 22:52:25 -04:00
moneromooo-monero
7e4e0021f4
daemon: print time to next fork 2016-08-12 20:32:23 +01:00
moneromooo-monero
11dc091464
Fake outs set is now decided by the wallet
This plugs a privacy leak from the wallet to the daemon,
as the daemon could previously see what input is included
as a transaction input, which the daemon hadn't previously
supplied. Now, the wallet requests a particular set of
outputs, including the real one.

This can result in transactions that can't be accepted if
the wallet happens to select too many outputs with non standard
unlock times. The daemon could know this and select another
output, but the wallet is blind to it. It's currently very
unlikely since I don't think anything uses non default
unlock times. The wallet requests more outputs than necessary
so it can use spares if any of the returns outputs are still
locked. If there are not enough spares to reach the desired
mixin, the transaction will fail.
2016-08-11 14:35:27 +01:00
moneromooo-monero
1593553e03
new unlocked parameter to output_histogram
This constrains the number of instances of any amount
to the unlocked ones (as defined by the default unlock time
setting: outputs with non default unlock time are not
considered, so may be counted as unlocked even if they are
not actually unlocked).
2016-08-01 22:16:00 +01:00
moneromooo-monero
b3801faafa
hardfork: fix off by one in rescaning fork state after restart
This code should die anyway.
2016-07-25 23:16:02 +01:00
moneromooo-monero
d7b681cd65
remove hf_starting_height db
It's not really needed, it used to be an optimization for when
that code was not using the db and needed to recalculate things
fast on startup.
2016-07-13 21:38:34 +01:00
blashyrkh
77d8fc3344
tx_extra: parse new chunk added by minergate
Patch from blashyrkh on forum.getmonero.org:
https://forum.getmonero.org/5/support/2530/simplewallet-returns-invalid-paymentid
2016-06-06 18:29:16 +01:00
Riccardo Spagni
e54e4d96a4
Merge pull request #831
9ef8c7b tests: fix tests broken by the removal of the block reward accumulation loop (moneromooo-monero)
a6e717e cn_deserialize: deserialize tx_extra too (moneromooo-monero)
3eff37f unit_tests: add a write_varint/read_varint test (moneromooo-monero)
7a66387 unit_tests: fix UNBOUND_LIBRARIES/UNBOUND_LIBRARY typo (moneromooo-monero)
d6bce4b core: move tx_extra parsing errors to log level 1 (moneromooo-monero)
2016-05-17 19:07:28 +02:00
moneromooo-monero
9ef8c7b694
tests: fix tests broken by the removal of the block reward accumulation loop
The tests for rejection of unmixable outputs in v2 are commented out,
as there are no unmixable outputs created anymore. This should be
restored at some point.
2016-05-01 20:59:41 +01:00
moneromooo-monero
d6bce4be36
core: move tx_extra parsing errors to log level 1
They're not fatal, though indicate something wrong
2016-05-01 11:35:06 +01:00
Riccardo Spagni
30dce45643 Merge branch 'performance' of https://github.com/LMDB/bitmonero 2016-04-29 21:41:43 +02:00
moneromooo-monero
513a658c87
add a --max-concurrency flag
It sets the max number of threads to use for a parallel job.
This is different that the number of total threads, since monero
binaries typically start a lot of them.
2016-04-28 20:33:59 +01:00
moneromooo-monero
70c86561af
blockchain: add missing overflow check for already generated coins
When reaching the tail emission phase, the amount of coins will
eventually go over MONEY_SUPPLY, overflowing 64 bits. There was
a check added to blockchain_storage, but this was not ported to
the blockchain DB version.

Reported by smooth.
2016-04-17 14:46:17 +01:00
moneromooo-monero
d6fd6be5de
blockchain: update cumulative block limit when popping a block
Avoids possible issues with accepting a tx too large to fit
in an actual block.

Reported by smooth.
2016-04-17 14:46:13 +01:00
Riccardo Spagni
8f78f1407e
Merge pull request #784
087373e Fix potential race with parallel processing of txes/signatures/blocks (moneromooo-monero)
2016-04-14 16:25:53 +09:00
Riccardo Spagni
17049fa8e8
Merge pull request #782
113cdc1 core: keep the acc loop for the genesis block (moneromooo-monero)
2016-04-14 16:25:18 +09:00
Riccardo Spagni
784a2108f4
Merge pull request #800
4cfb4df blockchain: remove the tx validation result cache (moneromooo-monero)
2016-04-14 16:21:08 +09:00
Riccardo Spagni
da277e17b5
Merge pull request #796
d817aec tx_pool: ensure no txes that fail check_inputs get in the block template (moneromooo-monero)
2016-04-14 16:20:17 +09:00
moneromooo-monero
4cfb4dff3e
blockchain: remove the tx validation result cache
As pointed out by smooth, a transaction's validity may change
over time as the blockchain changes.
2016-04-06 19:01:28 +01:00
moneromooo-monero
1aad759bf1
tx_pool: fix (hopefully) save/load of kept_by_block 2016-04-06 00:11:31 +01:00
Howard Chu
d7ea7d9a23 Merge branch 'performance' into master 2016-04-05 21:13:16 +01:00
warptangent
8d12a8df2c Schema update: tx_indices - improve further with less indirection 2016-04-05 20:54:06 +01:00
moneromooo-monero
d817aeca80
tx_pool: ensure no txes that fail check_inputs get in the block template 2016-04-05 13:06:29 +01:00
moneromooo-monero
087373eccf
Fix potential race with parallel processing of txes/signatures/blocks 2016-04-02 14:20:51 +01:00
moneromooo-monero
113cdc10a2
core: keep the acc loop for the genesis block
For unknown reasons, it was generated with a block reward
consisting of a single large dusty output.
2016-04-02 11:17:49 +01:00
Riccardo Spagni
cc54e2764a
Merge pull request #779
daac1cc core: remove the block reward accumulation loop (moneromooo-monero)
2016-04-02 12:05:57 +09:00
Riccardo Spagni
a38ad63f8f
Merge pull request #767
24b3e90 Convey tx verification failure reasons to the RPC client (moneromooo-monero)
2016-04-02 12:02:07 +09:00
Riccardo Spagni
44559ca4b0
Merge pull request #764
f746c9d minor corrections/clarifications (Thomas Winget)
c6bb201 Transaction pool documentation (and some cleanup) (Thomas Winget)
2016-04-02 12:01:15 +09:00
moneromooo-monero
daac1cc259
core: remove the block reward accumulation loop
This can generate non decomposed outputs for very large block
rewards (or not so large ones if a miner decides to not quantize
the block rewards). Out of an abundance of caution, we refuse
to generate those. They are still accepted by the consensus code,
however.
2016-04-01 21:42:19 +01:00
Thomas Winget
f746c9d01b
minor corrections/clarifications 2016-03-30 11:55:54 -04:00
Riccardo Spagni
2b57845766
Merge pull request #765
d5d46e6 tests: obligatory hardfork unit build fix after interface change (moneromooo-monero)
25672d3 wallet: pass std::function by const ref, not value (moneromooo-monero)
0be6e08 wallet: do not leak owned amounts to the daemon unless --trusted-daemon (moneromooo-monero)
12146da wallet: change sweep_dust to sweep_unmixable (moneromooo-monero)
600a3cf New RPC and daemon command to get output histogram (moneromooo-monero)
f9a2fd2 wallet: handle rare case where fee adjustment can bump to the next kB (moneromooo-monero)
f26651a wallet: factor fee calculation (moneromooo-monero)
2016-03-27 14:09:53 +02:00
moneromooo-monero
24b3e9007a
Convey tx verification failure reasons to the RPC client
This allows appropriate action to be taken, like displaying
the reason to the user.

Do just that in simplewallet, which should help a lot in
determining why users fail to send.

Also make it so a tx which is accepted but not relayed is
seen as a success rather than a failure.
2016-03-27 12:37:18 +01:00
moneromooo-monero
600a3cf0c0
New RPC and daemon command to get output histogram
This is a list of existing output amounts along with the number
of outputs of that amount in the blockchain.

The daemon command takes:
- no parameters: all outputs with at least 3 instances
- one parameter: all outputs with at least that many instances
- two parameters: all outputs within that many instances

The default starts at 3 to avoid massive spamming of all dust
outputs in the blockchain, and is the current minimum mixin
requirement.

An optional vector of amounts may be passed, to request
histogram only for those outputs.
2016-03-26 21:10:43 +00:00
moneromooo-monero
b8527668ff
blockchain: for v3, require miner tx to have well behaved outs
This was meant to go in v2, but the miner tx slipped through
the cracks as it doesn't go through the main tx verification
since it doesn't get added to the pool.
2016-03-25 15:11:53 +00:00
moneromooo-monero
97638b1fb7
core: fix miner tx block reward with fees 2016-03-25 15:11:45 +00:00
Riccardo Spagni
0d30b65785 Merge pull request #749
bfd4a28 Update BlockchainDB documentation (Thomas Winget)
797357e Change Doxyfile, Blockchain not blockchain_storage (Thomas Winget)
c835215 remove defunct code from cryptonote::core (Thomas Winget)
50dba6d cryptonote::core doxygen documentation (Thomas Winget)
8ac329d doxygen documentation for difficulty functions (Thomas Winget)
540a76c Move checkpoint functions into checkpoints class (Thomas Winget)
1b0c98e doxygen documentation for checkpoints.{h,cpp} (Thomas Winget)
89c24ac Remove unnecessary or defunct code (Thomas Winget)
ab0ed14 doxygen include private and static members (Thomas Winget)
3a48449 Updated documentation for blockchain.* (Thomas Winget)
2016-03-25 09:12:25 +02:00
Riccardo Spagni
01e0a69c17 Revert "Merge pull request #749"
This reverts commit 7fa63a82a1, reversing
changes made to cb6be986c3.
2016-03-25 08:42:42 +02:00
Riccardo Spagni
7fa63a82a1
Merge pull request #749
bfd4a28 Update BlockchainDB documentation (Thomas Winget)
797357e Change Doxyfile, Blockchain not blockchain_storage (Thomas Winget)
c835215 remove defunct code from cryptonote::core (Thomas Winget)
50dba6d cryptonote::core doxygen documentation (Thomas Winget)
8ac329d doxygen documentation for difficulty functions (Thomas Winget)
540a76c Move checkpoint functions into checkpoints class (Thomas Winget)
1b0c98e doxygen documentation for checkpoints.{h,cpp} (Thomas Winget)
89c24ac Remove unnecessary or defunct code (Thomas Winget)
ab0ed14 doxygen include private and static members (Thomas Winget)
3a48449 Updated documentation for blockchain.* (Thomas Winget)
2016-03-25 08:22:06 +02:00
Thomas Winget
c6bb201a07
Transaction pool documentation (and some cleanup)
tx_pool.h doxygen documentation completed.
Many notes made on areas for improvement, be that functionality or
code clarity.
Commented code and unused code removed.
2016-03-24 20:03:02 -04:00
Thomas Winget
c835215ea9
remove defunct code from cryptonote::core 2016-03-24 03:39:58 -04:00
Thomas Winget
50dba6d301
cryptonote::core doxygen documentation 2016-03-24 03:39:55 -04:00
Thomas Winget
8ac329df02
doxygen documentation for difficulty functions 2016-03-24 03:39:52 -04:00
Thomas Winget
540a76c5c2
Move checkpoint functions into checkpoints class
The functions in src/cryptonote_core/checkpoints_create.{h,cpp} should
be member functions of the checkpoints class, if nothing else for the
sake of keeping their documentation together.

This commit covers moving those functions to be member functions of the
checkpoints class as well as documenting those functions.
2016-03-24 03:39:41 -04:00
Thomas Winget
1b0c98e7e9
doxygen documentation for checkpoints.{h,cpp}
All functions in src/cryptonote_core/checkpoints.h are now documented in
doxygen style.

checkpoints.cpp has been reviewed, one function has been marked for
discussion on correctness.
2016-03-22 20:23:15 -04:00
Thomas Winget
89c24ac2be
Remove unnecessary or defunct code 2016-03-22 20:23:06 -04:00
Thomas Winget
3a484497bc
Updated documentation for blockchain.*
All functions are now documented in doxygen format.  Comments have been
updated to reflect the current state of the code.  Many areas for
improvement in clarity and design have been noted, as well as cruft to
be removed.  These changes are not reflected in this commit both to
allow time for comment and to keep commits organized by purpose.
2016-03-22 17:30:21 -04:00
moneromooo-monero
cc4b19c32e
blockchain: fix partial block reward detection 2016-03-22 15:37:16 +00:00
Riccardo Spagni
bdc07f029a
Merge pull request #743
a1c3829 also maybe do the block height this time, you know, just so that it actually works. (Riccardo Spagni)
2016-03-21 13:22:54 +02:00
Riccardo Spagni
a1c38299b3
also maybe do the block height this time, you know, just so that it actually works. 2016-03-21 13:19:49 +02:00
Riccardo Spagni
93c2c1b4ba
Merge pull request #742
23d1538 also update the timestamp for the hard fork (Riccardo Spagni)
2016-03-21 13:14:27 +02:00
Riccardo Spagni
23d1538fe7
also update the timestamp for the hard fork 2016-03-21 13:09:35 +02:00
Riccardo Spagni
def05d6353
Merge pull request #741
eda51a0 set fork date for September, add hyc's GPG key, remove aabramov's (Riccardo Spagni)
2016-03-21 12:56:11 +02:00
Riccardo Spagni
eda51a0dc3
set fork date for September, add hyc's GPG key, remove aabramov's 2016-03-21 12:53:49 +02:00
moneromooo-monero
f7301c3563
Revert "Print stack trace upon exceptions"
Ain't nobody got time for link/cmake skullduggery.

This reverts commit fff238ec94.
2016-03-21 10:12:23 +00:00
moneromooo-monero
fff238ec94
Print stack trace upon exceptions
Useful for debugging users' logs
2016-03-19 21:48:36 +00:00
Howard Chu
9b3e43c327 Fix issue #706 2016-03-19 12:57:47 +00:00
Howard Chu
b937a2c915 Use boost::thread instead of std::thread
and all other associated IPC
2016-03-11 15:09:50 +00:00
warptangent
a49c355cae
Blockchain: Omit verbose time stats messages by default
This is already the default for the daemon, but by checking a command
line argument and calling a Blockchain member function setter.

Initialize the variable to false so it's not dependent on an external
command-line argument check. This allows utilities like
blockchain_import to have a reasonable default without code changes.
2016-03-03 20:14:48 -08:00
Riccardo Spagni
bf09285443
Merge pull request #688
c2a1fee simplewallet: prompt for private keys when generating wallets (moneromooo-monero)
4513b4c simplewallet: add a new --restore-from-keys option (moneromooo-monero)
2016-02-29 17:30:29 -05:00
Howard Chu
5a07cefe7b Wrap some more actions in a larger read txn 2016-02-23 20:47:15 +00:00
Howard Chu
8cc7a36f0b read txn/cursor stuff
Could wrap more later.
2016-02-23 20:47:15 +00:00
moneromooo-monero
86a7f2b1e7 core: check whether an update is needed straight away 2016-02-23 20:29:17 +00:00
moneromooo-monero
ea5fa5e9b6 core: print "update needed" hard fork notifications in red 2016-02-23 20:29:17 +00:00
moneromooo-monero
4513b4cd2b
simplewallet: add a new --restore-from-keys option
It is similar in use to --restore-from-view-key, but also expects
a spend private key.

Requested by luigi1112, and useful to restore MyMonero wallets.
2016-02-22 22:10:55 +00:00
moneromooo-monero
27d4e50dfa
core: check whether an update is needed straight away 2016-02-17 22:57:38 +00:00
moneromooo-monero
889217381f
core: print "update needed" hard fork notifications in red 2016-02-17 22:57:14 +00:00
moneromooo-monero
759383c52d
hardfork: add a default fork entry for v1 if none exist
To avoid special cases
2016-02-08 20:58:06 +00:00
moneromooo-monero
c7f82ec769
blockchain: initialize m_hardfork to NULL
It can now be set by some other code, and is thus tested
2016-02-08 20:57:20 +00:00
moneromooo-monero
a333c42cde
core_tests: add tests for hard fork behaviors (MRL-0004)
We also replace the --fakechain option with an optional structure
containing details about configuration for the core/blockchain,
for test purposes. This seems more future friendly.
2016-02-08 18:52:00 +00:00
moneromooo-monero
6c8e5c3459
blockchain: reset hardfork object when resetting blockchain
Not doing so will prevent the new genesis block from being
reset if a switch past v1 had occured already.
2016-02-08 18:22:03 +00:00
warptangent
e298b14a55
Blockchain: Update comments on removing block 2016-02-08 09:28:25 -08:00
warptangent
e02577f594
Move HardFork DB update to BlockchainDB::add_block()
Ensures the database is consistent.

Also simplifes blockchain_import in that verify mode off has less to
work around.
2016-02-08 09:28:19 -08:00
warptangent
3800875406
Make HardFork object available to BlockchainDB and derived DB implementations
This will later allow the HardFork object's DB update functions to be
called when the DB transaction that persists across block add/remove is
open.
2016-02-08 09:28:17 -08:00
warptangent
8f863e742d
Blockchain: Optionally pass in HardFork object 2016-02-08 08:50:51 -08:00
Riccardo Spagni
de78962e1c
Merge pull request #643
05bfb51 core: move the db lock to the data directory (moneromooo-monero)
2016-02-08 18:32:08 +02:00
Riccardo Spagni
cea6f6fb9c
Merge pull request #641
7658ac0 blockchain: revert handle_get_objects adding block id on tx not found (moneromooo-monero)
3a0f4d8 berkeleydb: fix delete/free mismatch (moneromooo-monero)
1642be2 minor bugfixes and refactoring (Thomas Winget)
098dcf2 unit_tests: fix mnemonics unit test testing invalid seeds (moneromooo-monero)
2016-02-08 18:31:42 +02:00
moneromooo-monero
05bfb51d3e
core: move the db lock to the data directory
Locking just one db turns out to not have been a good idea, since
the pool and p2p state fdles have to be used anyway.

Also ensure the directory exists before tring to lock.
2016-02-04 18:09:45 +00:00
moneromooo-monero
7658ac0f45
blockchain: revert handle_get_objects adding block id on tx not found
This differs from the original CN code, and there seems to be
no reason to include the block itself, if it was found
2016-02-03 21:08:03 +00:00
Thomas Winget
1642be242d minor bugfixes and refactoring
- Blockchain should store if it's running on testnet or not

- moved loading compiled-in block hashes to its own function for clarity

- on handle_get_objects, should now correctly return false if a block's
transactions are missing

- replace instances of BOOST_FOREACH with C++11 for loops in Blockchain.
2016-02-02 18:58:39 +00:00
moneromooo-monero
64a2aa3376
hardfork: allow passing chain height in get(height) for convenience 2016-02-01 20:06:55 +00:00
Riccardo Spagni
f780f2e7ba
Merge pull request #635
8b3539b core: prevent the database from being used by multiple daemons (moneromooo-monero)
2016-01-31 15:22:14 +02:00
Riccardo Spagni
569316aea3
Merge pull request #634
7fc6fa3 wallet: forbid dust altogether in output selection where appropriate (moneromooo-monero)
5e1a739 blockchain: log number of outputs available for a new tx (moneromooo-monero)
2016-01-31 15:21:45 +02:00
Riccardo Spagni
39d73d2a27
Merge pull request #631
bcac101 daemon: fix a few issues reported by valgrind (moneromooo-monero)
a7e8174 tx_pool: fix serialization of new relayed data (moneromooo-monero)
601ad76 hardfork: fix mixup in indexing variable in get_voting_info (moneromooo-monero)
444e22f blockchain: remove unused timer (moneromooo-monero)
7edfdd8 blockchain: fix m_sync_counter uninitialized variable use (moneromooo-monero)
d97582c epee: use generate_random_bytes for new random uuids (moneromooo-monero)
17c7c9c epee: remove dodgy random code that nobody uses (moneromooo-monero)
2016-01-31 15:20:18 +02:00
moneromooo-monero
8b3539bc11
core: prevent the database from being used by multiple daemons
A boost lock is used to determine whether more than one process
wants to access the database. The boost file_lock doesn't seem
to like locking directories, so we use an arbitrary file in it.
This allows to still run two daemons if they have different
database directories (ie, LMDB/BDB, different data directories).
2016-01-31 12:58:08 +00:00
moneromooo-monero
5e1a7391e8
blockchain: log number of outputs available for a new tx 2016-01-31 10:59:58 +00:00
moneromooo-monero
a7e817482c
tx_pool: fix serialization of new relayed data 2016-01-30 22:14:09 +00:00
moneromooo-monero
601ad76a5e
hardfork: fix mixup in indexing variable in get_voting_info 2016-01-30 22:13:20 +00:00
moneromooo-monero
444e22f01a
blockchain: remove unused timer 2016-01-30 19:02:33 +00:00
moneromooo-monero
7edfdd8f24
blockchain: fix m_sync_counter uninitialized variable use
It counts the number of blocks added since last zeroing
2016-01-30 19:01:43 +00:00
moneromooo-monero
bf6d1474c0
new flush_txpool command, and associated RPC call
It can flush a particular tx, or the whole pool (the RPC command
can flush a list of transactions too)
2016-01-30 13:28:26 +00:00
moneromooo-monero
4b23714658
tx_pool: serialize missing kept_by_block flag 2016-01-29 19:44:25 +00:00
moneromooo-monero
94b98fb5fa
tx_pool: do not accept txes not in a block if they timed out before
This is intended to avoid cases where a timed out tx will be
re-relayed by another peer for which it has not timed out yet,
which would cause the tx to stay in the network's pool for a
long time (until all peers time it out before another one
tries to relay it again).
2016-01-29 17:21:25 +00:00
moneromooo-monero
eadbdf354a
tx_pool: fix use of invalidated iterator 2016-01-29 17:21:20 +00:00