Commit graph

985 commits

Author SHA1 Message Date
Howard Chu
d98d5e79cb Fix data refs in read-only txns
Data is only guaranteed to be valid within the lifetime of a txn.
You cannot use data returned from LMDB after the txn ends.
Also, fixed a missing txn.commit BlockchainLMDB::get_tx_unlock_time()
2015-12-10 01:45:40 +00:00
Riccardo Spagni
e175205e6e
Merge pull request #527
336b375 Register daemon command line arguments to core if they're used in core (moneromooo-monero)
2015-12-09 10:30:20 +02:00
moneromooo-monero
336b37580f
Register daemon command line arguments to core if they're used in core
This fixes coretests, which does not register daemon specific arguments,
but uses core, which uses those arguments. Also gets rid of an unwanted
dependency on daemon code from core.
2015-12-08 23:06:29 +00:00
Riccardo Spagni
b87f073a60
Merge pull request #526
2c83055 net_node: add a --offline argument (moneromooo-monero)
2015-12-08 20:12:18 +02:00
Riccardo Spagni
45191c3b30
Merge pull request #525
f746434 daemon: add mining status to the status command (moneromooo-monero)
2015-12-08 20:11:30 +02:00
Riccardo Spagni
8a5ba475cb
Merge pull request #524
1c8262c db_bdb: move log_set_config call before open (moneromooo-monero)
2015-12-08 20:11:06 +02:00
Riccardo Spagni
1fc1bfb677
Merge pull request #523
8620b31 db_bdb: support for libdb without DB_FORCESYNC (moneromooo-monero)
2015-12-08 20:10:34 +02:00
Riccardo Spagni
e7872656bc
Merge pull request #522
34e3889 p2p: failure to load p2pstate.bin is not fatal anymore (moneromooo-monero)
2015-12-08 20:10:04 +02:00
Riccardo Spagni
d5496f72e5
Merge pull request #520
a98e976 blockchain_db: fixup missing key images in early DB version (moneromooo-monero)
2015-12-08 20:08:56 +02:00
moneromooo-monero
2c83055597
net_node: add a --offline argument
It will not try to connect to the monero network, nor listen
2015-12-07 20:21:45 +00:00
moneromooo-monero
f7464343ea
daemon: add mining status to the status command 2015-12-07 19:40:12 +00:00
moneromooo-monero
1c8262c527
db_bdb: move log_set_config call before open
This is a precaution for older Berkeley DB versions.

- smooth reports an issue running with 4.7:
  DB_ENV->log_set_config: DB_LOG_IN_MEMORY: method not permitted
  after handle's open method
- this works just fine with 5.3
- we do not use DB_LOG_IN_MEMORY, but we use DB_LOG_AUTO_REMOVE
- libdb docs say some flags must be set before open, and some
  may be set at any time, but never say some must be set after
  open
- moving the call to log_set_config before open works with 5.3

Therefore, it seems best to move the call before open.
2015-12-07 19:22:22 +00:00
moneromooo-monero
8620b31019
db_bdb: support for libdb without DB_FORCESYNC 2015-12-07 09:31:53 +00:00
moneromooo-monero
34e388949d
p2p: failure to load p2pstate.bin is not fatal anymore
Clear any partially loaded data, and start with a default config
2015-12-07 00:20:56 +00:00
moneromooo-monero
a98e976f9e
blockchain_db: fixup missing key images in early DB version
Early DB versions did not store key images for inputs if the
transaction spending them had no outputs (ie, all fee). This
is not correct, as this would allow these outputs to be double
spent. This was fixed in 533acc30ed
a few months ago, but databases having synced blocks 2021612 and
685498 with a faulty version will be missing those key images
in the spent keys database. This code checks for this, and adds
those key images if they are missing.
2015-12-06 21:55:05 +00:00
moneromooo-monero
c6cfe0f26d
wallet: make the wallet refresh type a wallet setting
instead of a command line setting. It makes sense that is is
a long lived setting.
2015-12-05 21:44:25 +00:00
moneromooo-monero
fef2493617
wallet: default auto-refresh to true for old wallets 2015-12-05 21:10:12 +00:00
Riccardo Spagni
0252ffc37b
Merge pull request #518
1965fce wallet: add a stop_wallet RPC call (moneromooo-monero)
2015-12-05 21:58:56 +02:00
moneromooo-monero
a3c5ca077c
blockchain_db: make the indexing base a BlockchainDB virtual function 2015-12-05 18:41:29 +00:00
moneromooo-monero
1965fce402
wallet: add a stop_wallet RPC call 2015-12-05 14:53:37 +00:00
moneromooo-monero
a702118426
blockchain_dump: fix output key dump for BDB 1-based indices
Berkeley DB uses 1 based indices for RECNO databases, and the
implementation of BlockchainDB for Berkeley DB assumes 1 based
indices are passed to the API, whereas the LMDB one assumes
0 based indices. This is all internally consisteny, but since
the BDB code stores 1 based indices in the database, external
users have to be aware of this, as the indices will be off by
one depending on which DB is used.
2015-12-05 12:40:01 +00:00
moneromooo-monero
3bf35e14e3
db_bdb: read 32 bit heights from keys
Keys in Berkeley DB are 32 bits. We don't want to read random
bits in the high part.
2015-12-04 22:25:00 +00:00
Riccardo Spagni
2bed53cb6b
Merge pull request #515
0921f5b util: use putenv instead of setenv for mingw (moneromooo-monero)
2015-11-30 18:33:43 +02:00
moneromooo-monero
41029d6d74
wallet2: default auto-refresh to true for preexisting wallets 2015-11-30 11:08:15 +00:00
Riccardo Spagni
2ea8d7345f Revert "Merge pull request #506"
This reverts commit c6bf73131a, reversing
changes made to 8a52cf4055.
2015-11-30 11:07:22 +02:00
Riccardo Spagni
f78f9c5480
Merge pull request #512
36a298c simplewallet: add tr markers in a few missing user visible strings (moneromooo-monero)
2015-11-30 07:31:44 +02:00
moneromooo-monero
d68a63e404
wallet: cancellable refresh
^C while in manual refresh will cancel the refresh, since that's
often an annoying thing to have to wait for. Also, a manual refresh
command will interrupt any running background refresh and take
over, rather than wait for the background refresh to be done, and
look to be hanging.
2015-11-29 23:24:56 +00:00
Riccardo Spagni
8289975e22
Merge pull request #511
66849ac simplewallet: swap colors in show_transfers (moneromooo-monero)
2015-11-30 00:25:49 +02:00
moneromooo-monero
36a298c375
simplewallet: add tr markers in a few missing user visible strings 2015-11-29 22:24:15 +00:00
Riccardo Spagni
5275db0786
Merge pull request #509
3030e3e wallet2: remove confirmed transactions from detached blocks (moneromooo-monero)
2015-11-30 00:23:58 +02:00
Riccardo Spagni
bc1bc4adb2
Merge pull request #507
62e49a5 wallet: optional automatic refresh from the daemon (moneromooo-monero)
2015-11-30 00:19:47 +02:00
Riccardo Spagni
c6bf73131a
Merge pull request #506
e45a8c9 core: serialize block major/minor versions as bytes, not varints (moneromooo-monero)
2015-11-30 00:18:48 +02:00
Riccardo Spagni
8a52cf4055
Merge pull request #505
7574297 core_rpc_server: add a --restricted-rpc option (moneromooo-monero)
2015-11-30 00:18:20 +02:00
Riccardo Spagni
5c3b29792c
Merge pull request #504
9ee48e9 wallet2: speed up wallet refresh for large miners (moneromooo-monero)
4905903 wallet2: parallelize pulling blocks and processing them on refresh (moneromooo-monero)
d0eaf1d wallet2: maintain the short chain manually when refreshing (moneromooo-monero)
a4e9506 wallet2: split pull blocks between pulling and processing (moneromooo-monero)
2015-11-30 00:17:34 +02:00
Riccardo Spagni
83b412f471
Merge pull request #503
55e5a33 rpc: pass current block target in rpc (moneromooo-monero)
2015-11-30 00:16:58 +02:00
moneromooo-monero
66849ac236
simplewallet: swap colors in show_transfers
Green is now used for incoming transfers, and magenta for outgoing
transfers. This is consistent to the scheme used by other logging.
2015-11-29 13:20:54 +00:00
moneromooo-monero
3030e3ecff
wallet2: remove confirmed transactions from detached blocks 2015-11-29 12:07:54 +00:00
moneromooo-monero
9ee48e9071
wallet2: speed up wallet refresh for large miners 2015-11-28 21:15:07 +00:00
moneromooo-monero
62e49a5f02
wallet: optional automatic refresh from the daemon
The daemon will be polled every 90 seconds for new blocks.
It is enabled by default, and can be turned on/off with
set auto-refresh 1 and set auto-refresh 0 in the wallet.
2015-11-28 12:41:06 +00:00
moneromooo-monero
e45a8c9768
core: serialize block major/minor versions as bytes, not varints
This allows them to be saved as a fixed (one byte) chunk whatever
the value. Using a varint will use two bytes as the high bit gets
set.

This is backward compatible with current usage (0-2 values).
2015-11-27 20:54:01 +00:00
moneromooo-monero
75742977a8
core_rpc_server: add a --restricted-rpc option
It does not expose the RPC for commands like start_mining, etc
(ie, commands a public node operator might want to be restricted)
2015-11-27 18:27:24 +00:00
moneromooo-monero
490590306e
wallet2: parallelize pulling blocks and processing them on refresh
This needed locking the use of m_http_client, to avoid collisions
in I/O.
2015-11-27 17:25:15 +00:00
moneromooo-monero
d0eaf1d4e1
wallet2: maintain the short chain manually when refreshing 2015-11-27 00:35:41 +00:00
moneromooo-monero
a4e9506069
wallet2: split pull blocks between pulling and processing 2015-11-27 00:03:43 +00:00
moneromooo-monero
55e5a33d85
rpc: pass current block target in rpc
This fixes the hash rate being wrong on testnet after the switch
to 2 minute blocks
2015-11-26 00:25:13 +00:00
moneromooo-monero
38ceb73848
add RPC calls and commands to get/set bans 2015-11-26 00:04:22 +00:00
moneromooo-monero
7bc4dce6ed
net_node: allow bans for custom amounts of time
m_blocked_ips now stores the unblocking time, rather than the
blocking time.
Also change > to >=, since banning for 0 seconds should not ban
2015-11-25 22:23:04 +00:00
moneromooo-monero
0921f5b4d7
util: use putenv instead of setenv for mingw 2015-11-25 21:38:10 +00:00
Riccardo Spagni
4061a32082
Merge pull request #501
d887c18 hardfork: fix more major/minor issues (moneromooo-monero)
3b47ca2 hardfork: fix rescan on load (moneromooo-monero)
4cea2b1 Add IP blocking for misbehaving nodes (adapted from Boolberry) (Javier Smooth)
9c64b12 quiet down p2p logging a bit (Javier Smooth)
53c75ab blockchain: log versions as numbers, not characters (moneromooo-monero)
edade8d hardfork: fix actual/voting confusion (moneromooo-monero)
2015-11-24 23:04:51 +02:00
Riccardo Spagni
64d7384779
Merge pull request #500
06c8b94 daemon: fix blockchain height display not updating after sync (moneromooo-monero)
2015-11-24 23:04:04 +02:00
Riccardo Spagni
350e67c103
Merge pull request #499
410c6cf cn_deserialize: a new tool to decode blocks and transactions (moneromooo-monero)
2015-11-24 23:03:16 +02:00
Riccardo Spagni
1408a20be3
Merge pull request #498
3d0b3c5 add recent static checkpoint (Javier Smooth)
2015-11-24 23:02:41 +02:00
Riccardo Spagni
8ff2313f96
Merge pull request #497
9b945f5 wallet: make the refresh optimizations selectable via command line (moneromooo-monero)
d2c0313 wallet: speedup refresh from daemon (moneromooo-monero)
ea707c7 wallet2: minor cleanup (moneromooo-monero)
55a2da7 wallet2: speedup refresh a bit (moneromooo-monero)
2015-11-24 23:01:56 +02:00
moneromooo-monero
d887c18e33
hardfork: fix more major/minor issues
Also add some more tests, and rename some instances of
"version" and "add" for clarity.

NOTE: the starting height values are sometimes wrong.
I suspect this is due to the hard fork reorg code being
buggy, since they're good when syncing after the fact.
However, they're not actually used by the consensus code,
so I'm ignoring this for now, but this needs debugging.
2015-11-24 20:47:12 +00:00
moneromooo-monero
3b47ca2d7d
hardfork: fix rescan on load 2015-11-23 21:12:55 +00:00
Javier Smooth
4cea2b13b2 Add IP blocking for misbehaving nodes (adapted from Boolberry)
With minor cleanup and fixes (spelling, indent) by moneromooo
2015-11-23 18:06:20 +00:00
Javier Smooth
9c64b12320 quiet down p2p logging a bit 2015-11-23 17:20:47 +00:00
moneromooo-monero
53c75ab4a0
blockchain: log versions as numbers, not characters 2015-11-23 15:53:59 +00:00
moneromooo-monero
edade8dc81
hardfork: fix actual/voting confusion 2015-11-23 14:04:33 +00:00
moneromooo-monero
06c8b94925
daemon: fix blockchain height display not updating after sync 2015-11-23 13:16:05 +00:00
moneromooo-monero
410c6cf3bd
cn_deserialize: a new tool to decode blocks and transactions 2015-11-22 21:52:14 +00:00
Javier Smooth
3d0b3c5018 add recent static checkpoint 2015-11-22 13:32:19 -08:00
moneromooo-monero
9b945f5211
wallet: make the refresh optimizations selectable via command line
Take the opportunity to add a no-coinbase case too, for even faster
sync when an address is known to never have mined to.
2015-11-22 19:03:10 +00:00
Riccardo Spagni
263cc48c48
Merge pull request #495
328636c fixed testnet fork point, added comment data back in (Riccardo Spagni)
aed3038 disable time-stats by default, tweak fast-block-sync description (Riccardo Spagni)
8fe1111 update v2 testnet fork height (Riccardo Spagni)
4d74510 checkpoints update (Riccardo Spagni)
2015-11-22 20:43:35 +02:00
moneromooo-monero
d2c031332e
wallet: speedup refresh from daemon
Assume the whole of a coinbase goes to the same address (so that
if the first output isn't for us, none of it is), and only look
for payment id when we received something in the transaction.
2015-11-22 18:07:19 +00:00
moneromooo-monero
ea707c779c
wallet2: minor cleanup
- use std::vector::std::deque to not leak when exceptions happen
- use std::unique_ptr instead of the deprecated std::auto_ptr
2015-11-22 18:07:14 +00:00
moneromooo-monero
55a2da7475
wallet2: speedup refresh a bit
Use the NoodleDoodle threading technique to speedup a couple
code blocks on the main path when refreshing blocks without
any transactions for us.
2015-11-22 18:07:07 +00:00
Riccardo Spagni
328636cdb3
fixed testnet fork point, added comment data back in 2015-11-22 19:40:38 +02:00
Riccardo Spagni
72a348e734
Merge pull request #496
db1fb66 wallet: storing outgoing tx info now defaults to enabled (moneromooo-monero)
9156ba3 wallet: rename store-tx-keys to store-tx-info (moneromooo-monero)
b3d4d41 wallet: improve show_transfers (moneromooo-monero)
725ae4e wallet: use incoming blocks to keep track of payments too (moneromooo-monero)
00790a8 simplewallet: lessen display flicker confusion (moneromooo-monero)
2015-11-22 16:47:14 +02:00
moneromooo-monero
db1fb66e66
wallet: storing outgoing tx info now defaults to enabled
The info is stored encrypted, and is pretty useful, often after
the fact.
2015-11-22 12:40:03 +00:00
moneromooo-monero
9156ba3a3c
wallet: rename store-tx-keys to store-tx-info
With backward compatibility
2015-11-22 12:26:27 +00:00
moneromooo-monero
b3d4d41e29
wallet: improve show_transfers
More information is now saved and displayed
2015-11-22 12:13:59 +00:00
moneromooo-monero
725ae4e710
wallet: use incoming blocks to keep track of payments too 2015-11-21 23:22:15 +00:00
Riccardo Spagni
aed3038b75
disable time-stats by default, tweak fast-block-sync description 2015-11-21 15:57:23 +02:00
Riccardo Spagni
8fe1111b5b
update v2 testnet fork height 2015-11-21 15:36:13 +02:00
Riccardo Spagni
4d74510a4a
checkpoints update 2015-11-21 15:11:21 +02:00
moneromooo-monero
00790a8921
simplewallet: lessen display flicker confusion
Height seemed to be flying all over the place on a rescan here.
Logging to a file shows the heights are actually correct, and
this is some kind of screen refresh artifact. Flush after \r
and update less often to reduce this effect a lot.
2015-11-21 11:52:35 +00:00
Riccardo Spagni
9276233b9e
Merge pull request #493
f3724ae Fix startup crash when using a locale boost does not like (moneromooo-monero)
0c1dae3 i18n: allow language to be passed as a parameter (moneromooo-monero)
2015-11-21 13:08:42 +02:00
moneromooo-monero
f3724aef88
Fix startup crash when using a locale boost does not like
There are various locale related bugs in various versions of boost,
where exceptions are thrown in boost::filesystem APIs when the
current locale is not to boost's liking. It's not clear what "not
to boost's liking" means in detail, though "en" and "en_US.UTF-8"
are not to its liking.

Fix it by running a test function that's known to throw in such
a case, and resetting LANG and LC_ALL to C if an exception is
thrown. In simplewallet, the locale is queried before that so the
correct translations will still be used.
2015-11-21 10:13:10 +00:00
moneromooo-monero
0c1dae32b4
i18n: allow language to be passed as a parameter
If empty, it will still be fetched from the environment
2015-11-21 10:11:50 +00:00
moneromooo-monero
932994c0cb
Relay transactions when they linger too long in the pool
The last relayed time of a transaction is maintained, and
transactions will be relayed again if they are still in the
pool after a certain amount of time, which increases with
the transaction's age. All such transactions are resent,
whether or not they originated on the local node.
2015-11-21 00:56:21 +00:00
Riccardo Spagni
0d09e15a1c
Merge pull request #490
baf101e More changes for 2-min blocks Use the correct block time for realtime fuzz on locktime Use the correct block time to calculate next_difficulty on alt chains (will not work as-is with voting) Lock unit tests to original block time for now (Javier Smooth)
4fea1a5 Adjust difficulty target (2 min) and full reward zone (60 kbytes) for block version 2 (Javier Smooth)
2015-11-18 10:37:27 +02:00
Riccardo Spagni
61a015d01d
Merge pull request #487
3f611bc wallet: track outgoing payments and add a show_transfers command (moneromooo-monero)
2015-11-18 10:36:34 +02:00
moneromooo-monero
3f611bc3dc
wallet: track outgoing payments and add a show_transfers command
It's a user friendly display of incoming and outgoing transfers,
listed by height, within an optional height range.
2015-11-15 21:59:40 +00:00
moneromooo-monero
1b40952754
Revert "db_bdb: record numbers for recno databases start at 1"
It looks like some of the indices passed to the DB access functions
are already bumped by 1. Moreover, the existing code was not
throwing DB errors with 0 keys, and this is unlikely if it really
was using 0 keys. Last, this patch broke sync from scratch in at
least one case. So I'm calling it bad and reverting it.

This reverts commit bfc97401ae81bb30278a318de7f048c653bf6582.
2015-11-13 09:28:17 +00:00
Javier Smooth
baf101ef4a More changes for 2-min blocks
Use the correct block time for realtime fuzz on locktime
Use the correct block time to calculate next_difficulty on alt chains (will not work as-is with voting)
Lock unit tests to original block time for now
2015-11-13 00:37:35 -08:00
Javier Smooth
4fea1a5fe7 Adjust difficulty target (2 min) and full reward zone (60 kbytes) for block version 2 2015-11-13 00:30:45 -08:00
moneromooo-monero
2f254ff599
hardfork: add a get_ideal_version(uint64_t) function
It returns the ideal version for a given height, which is
based on the minimum height for a fork, disregarding votes
2015-11-10 09:45:51 +00:00
moneromooo-monero
4187e569d8
hardfork: allow per-fork voting thresholds
And setup the first fork to not vote
2015-11-08 13:04:41 +00:00
Riccardo Spagni
575af61815
Merge pull request #470
b1d0c8a blockchain_dump: fix build without berkeley db (moneromooo-monero)
2015-11-01 14:12:13 +02:00
moneromooo-monero
b1d0c8a049
blockchain_dump: fix build without berkeley db 2015-10-30 22:48:04 +00:00
moneromooo-monero
c7dc6ef8e8
simplewallet: add a set default-mixin command
The default default mixin is 4. It can now be changed per wallet.
2015-10-30 21:16:51 +00:00
moneromooo-monero
5f8baba26e
wallet2: fix CLANG compile error 2015-10-30 14:35:55 +00:00
Riccardo Spagni
5978fc18f7
Merge pull request #463
051ddbc rpc: fix start_mining and status RPC crashes (moneromooo-monero)
2015-10-30 09:59:22 +02:00
Riccardo Spagni
9ea58ebbae
Merge pull request #461
bc110af blockchain_utilities: properly exit on error (moneromooo-monero)
2015-10-30 09:59:00 +02:00
Riccardo Spagni
6960b1e8a9
Merge pull request #460
4f873bc Remove some old/obsolete/unused code (moneromooo-monero)
2015-10-30 09:58:41 +02:00
Riccardo Spagni
167e8512ff
Merge pull request #457
e70d2e5 common: const and init list pedantry (moneromooo-monero)
2015-10-30 09:58:18 +02:00
Riccardo Spagni
62b0984e65
Merge pull request #455
6df4e67 Fix a possibly-unused warning, and rationalize types (moneromooo-monero)
2015-10-30 09:57:41 +02:00
moneromooo-monero
051ddbc741
rpc: fix start_mining and status RPC crashes
They check whether they're running on testnet by accessing the
m_rpc_server object, which does not exist when in RPC mode.

Also, fix hard_fork_info being called with the wrong API.
2015-10-28 18:09:36 +00:00
moneromooo-monero
bc110af0ee
blockchain_utilities: properly exit on error
Replace boolean values and exceptions where appropriate
2015-10-27 16:15:41 +00:00