Commit graph

997 commits

Author SHA1 Message Date
moneromooo-monero f33a88cfc1
blockchain: fix a few block addition bugs
If the block reward was too high, the verification failed flag
was set, but the function continued. The code which was supposed
to trap this flag and return failure failed to trap it, and,
while the block was not added to the chain, the function would
return success.
The reason for avoiding returning when the block reward problem
was detected was to be able to return any transactions to the
pool if needed. This is now mooted by moving the transaction
return code to a separate function, which is now called at all
appropriate points, making the logic much simpler, and hopefully
correct now.
We also move the hard fork version check after the prev_id check,
as block which does not go on the top of the chain might not
have the expected version there, without being invalid just for
this reason.
Last, we trap the case where a block fails to be added due to
using already spent key images, to set the verification failed
flag.
2015-12-25 22:13:38 +00:00
moneromooo-monero a9ff11c816
blockchain: fix an off by one error in unlocked time check 2015-12-25 22:12:52 +00:00
moneromooo-monero f294be35bc
blockchain: reinstate double spending checks in check_tx_inputs
This fixes some double spending tests.
This may or may not be unneeded in normal (non test) circumstances,
to be determined later. Keeping these for now may be slower, but safer.
2015-12-25 22:11:21 +00:00
moneromooo-monero 737b6d6cf5
blockchain: make some flag twiddling code closer to the original
Probably paranoid and unnecessary
2015-12-25 22:10:27 +00:00
moneromooo-monero 81cb0fcdcc
blockchain: fix bitflipping test with quantized block rewards
Block reward may now be less than the full amount allowed.
This was breaking the bitflipping test.
We now keep track of whether a block which was accepted by the core
has a lower than allowed block reward, and allow this in the test.
2015-12-25 22:07:58 +00:00
moneromooo-monero 22ddf09bea
blockchain: add missing m_tx_pool.on_blockchain_dec
It was missing in the port to DB.
This is actually a noop, so should not have functional changes.
2015-12-25 22:04:13 +00:00
moneromooo-monero d837c0ca90
blockchain: fix switch to alternative blockchain for more than one block
When rolling over more than one block, the db height will decrease,
but the split height should be constant, as per the original code.
2015-12-25 22:02:07 +00:00
moneromooo-monero 5cec076e13
blockchain: add a missing validity check to rollback_blockchain_switching
It was present in the original code
2015-12-25 22:01:21 +00:00
moneromooo-monero 3cabdb5ef2
core: catch exceptions from get_output_key
This can happen when trying to find an amount that does not exist,
and fixes a core test.
2015-12-25 21:59:26 +00:00
moneromooo-monero 5eef64578b
db: throw when given a non txout_to_key output to add
The check was explicit in the original version, so it seems
safer to make it explicit here, especially as it is now done
implicitely in a different place, away from the original check.
2015-12-25 21:56:37 +00:00
Riccardo Spagni 47ca455ea8
fixed missing parenthesis 2015-12-24 18:11:11 +02:00
Lex Kalinkin a004130a04 fix for 'failed to generate new wallet: failed to save file' error during wallet generation 2015-12-24 16:12:42 +02:00
moneromooo-monero 17ff6f2114
net_node: fix a hang on exit
One loop was not paying attention to the stop signal, and could
end up looping forever
2015-12-22 12:38:52 +00:00
Riccardo Spagni 40880d7cb8
Merge pull request #552
9428d53 Strip redundant includes (hyc)
2015-12-22 10:29:29 +02:00
Riccardo Spagni c41f785d56
Merge pull request #550
8c93608 wallet: fix load/save versioning bug for recently added tx data (moneromooo-monero)
2015-12-22 10:27:44 +02:00
Riccardo Spagni aa7d6c5412
Merge pull request #547
8ea7af1 Allow the wallet to access hard fork information (moneromooo-monero)
760331b epee: make log macros behave like statements (moneromooo-monero)
3f2970f Add missing semicolons after log statements (moneromooo-monero)
2015-12-22 10:10:54 +02:00
Riccardo Spagni b42966aead
Merge pull request #545
0ab56b8 print top block hash in daemon diff command (moneromooo-monero)
2015-12-22 10:07:35 +02:00
hyc 9428d53d6f Strip redundant includes
In particular, <boost/program_options.hpp> blows up daemon.cpp.obj,
making it too big to compile in debug mode on Win32. Even on a
release build it drops daemon.cpp.o on Linux from 31MB to 20MB.
This has no effect on the final linked binary size.
2015-12-21 16:23:59 +00:00
moneromooo-monero 8c93608f2f
wallet: fix load/save versioning bug for recently added tx data
The version number passed to those data's serialize function
was always 0, not the wallet's version as I had expected.
A version number now exists for these structures so they're
versioned correctly.
2015-12-20 14:03:15 +00:00
moneromooo-monero 8ea7af1ba3
Allow the wallet to access hard fork information
And make it change behavior slightly when close/after first hard fork
2015-12-19 14:52:30 +00:00
moneromooo-monero 3f2970fadb
Add missing semicolons after log statements 2015-12-19 14:47:37 +00:00
moneromooo-monero 0ab56b80db
print top block hash in daemon diff command
and add top block hash in get_info RPC
2015-12-18 19:56:17 +00:00
Riccardo Spagni 5d33b43d8d
Merge pull request #544
01e92eb replace std::auto_ptr with std::unique_ptr (moneromooo-monero)
2015-12-18 12:18:00 +02:00
Riccardo Spagni 64ff3c7201
Merge pull request #543
63cb1a5 move another non user useful log to L1 (moneromooo-monero)
02827d5 p2p: minor log formatting fix (moneromooo-monero)
2015-12-18 12:16:10 +02:00
Riccardo Spagni 45249d92a7
Merge pull request #542
9b4f8b4 wallet: save to a temporary file, then rename (moneromooo-monero)
2015-12-18 12:15:01 +02:00
moneromooo-monero 01e92ebdb0
replace std::auto_ptr with std::unique_ptr
The former is obsolete
2015-12-17 22:47:13 +00:00
moneromooo-monero 63cb1a59aa
move another non user useful log to L1 2015-12-17 22:35:34 +00:00
moneromooo-monero 02827d5155
p2p: minor log formatting fix 2015-12-17 22:35:01 +00:00
moneromooo-monero 9b4f8b4b7e
wallet: save to a temporary file, then rename
This should avoid most of wallet cache corruption cases
2015-12-17 22:32:54 +00:00
Riccardo Spagni f7d41d6e28
Merge pull request #541
5131b26 Replace tabs and remove trailing whitespace (warptangent)
0d40de4 Optionally restrict DNS queries to TCP (warptangent)
2015-12-16 22:59:23 +02:00
Riccardo Spagni 814c8241cd
Merge pull request #536
9079a32 Fix typo (warptangent)
3796941 blockchain.cpp: Change indentation from 4 to 2 spaces (warptangent)
725acc7 Replace tabs with two spaces for consistency with rest of codebase (warptangent)
2015-12-16 22:58:37 +02:00
warptangent 5131b263ed Replace tabs and remove trailing whitespace 2015-12-15 10:13:24 -08:00
warptangent 0d40de48c2
Optionally restrict DNS queries to TCP
Sample use:
DNS_PUBLIC=tcp torsocks bin/bitmonerod --p2p-bind-ip 127.0.0.1

Test:
Run above with --log-level 4 with and without DNS_PUBLIC environment
variable set.

DNS debugging info should show successful DNS lookups only when
DNS_PUBLIC is set to "tcp":

  DNS lookup for seeds.moneroseeds.se: 17 results
  DNS lookup for seeds.moneroseeds.ae.org: 17 results
  DNS lookup for seeds.moneroseeds.ch: 12 results
  DNS lookup for seeds.moneroseeds.li: 12 results
2015-12-15 10:13:16 -08:00
warptangent 9079a32c07
Fix typo 2015-12-15 06:33:22 -08:00
warptangent 3796941d8e
blockchain.cpp: Change indentation from 4 to 2 spaces 2015-12-15 06:33:15 -08:00
warptangent 725acc7f17
Replace tabs with two spaces for consistency with rest of codebase
Remove trailing whitespace in same files.
2015-12-15 06:22:06 -08:00
Riccardo Spagni 0576ff42b5
Merge pull request #540
75fd96d Revert connection limit to more customary 8 (Javier Smooth)
2015-12-15 15:31:32 +02:00
Riccardo Spagni 617b8c4376
Merge pull request #538
d462c62 db_lmdb: always use a batch tx if possible (moneromooo-monero)
2015-12-15 15:25:25 +02:00
Riccardo Spagni 4550717464
Merge pull request #537
a74cc1b hardfork: only accept major versions we know about (moneromooo-monero)
2015-12-15 15:24:56 +02:00
Riccardo Spagni ba7a01646d
Merge pull request #535
cb4ee1b Tone down L0 logs during daemon sync some more (moneromooo-monero)
2177923 Tone down a bit L0 logs during daemon sync (moneromooo-monero)
2015-12-15 15:22:09 +02:00
Javier Smooth 75fd96dcda Revert connection limit to more customary 8 2015-12-14 18:45:52 -08:00
moneromooo-monero d462c62343
db_lmdb: always use a batch tx if possible
Also wrap that code in two prefix/suffix macros so they are
easier to use and not forget. Also add consts to returned data
casts where applicable.
2015-12-14 18:47:13 +00:00
moneromooo-monero cb4ee1b50d
Tone down L0 logs during daemon sync some more 2015-12-14 17:45:32 +00:00
moneromooo-monero a74cc1bee2
hardfork: only accept major versions we know about 2015-12-14 09:17:07 +00:00
moneromooo-monero 217792351d
Tone down a bit L0 logs during daemon sync 2015-12-14 00:36:37 +00:00
moneromooo-monero fefc0b5556
daemon: fix crash exiting with ^C
We need to stop the p2p layer, which causes the rest to shutdown
gracefully. Hitting ^C was still going through another path.
2015-12-13 23:56:02 +00:00
Riccardo Spagni 3a4db6346b
Merge pull request #533
7f77b23 posix_daemonizer: only create the main daemon object in the last child (moneromooo-monero)
2015-12-13 22:17:11 +02:00
Riccardo Spagni 0eb3b6645c
Merge pull request #532
79ff6a5 Add LMDB error string to database transaction exception message (warptangent)
2015-12-13 22:16:05 +02:00
Riccardo Spagni bdf738bc7f
Merge pull request #531
cbded43 core_tests: fix ring_signature_1 tests (moneromooo-monero)
c3d208f core_tests: bump default test fee to 0.02 monero (moneromooo-monero)
10da0a0 add a --fakechain argument for tests (moneromooo-monero)
eee44e6 unit_tests: fix block reward test using post hard fork settings (moneromooo-monero)
595893f blockchain: log block (not chain) height in "BLOCK SUCCESFULLY ADDED" (moneromooo-monero)
2369968 blockchain: fix off by one in get_blocks (moneromooo-monero)
8af913a db_lmdb: implement BlockchainLMDB::reset (moneromooo-monero)
4833f4f db_bdb: implement BlockchainBDB::reset (moneromooo-monero)
18bf06e tx_pool: fix "minumim" typo in message (moneromooo-monero)
44f1267 tests: fix a typo in test name (moneromooo-monero)
1494557 db_lmdb: create all needed directories, not just the leaf one (moneromooo-monero)
015b68a db_bdb: create all needed directories, not just the leaf one (moneromooo-monero)
f141869 tests: remove data-dir argument registration (moneromooo-monero)
2015-12-13 22:14:56 +02:00
Riccardo Spagni 281c1c1639
Merge pull request #530
0198306 Stop displaying internal commands for --help (luigi1111)
189d516 simplewallet help & error cleanup (luigi1111)
2015-12-13 22:05:21 +02:00