Commit graph

544 commits

Author SHA1 Message Date
Michael Ford c5b390b6b9 Make comments in main an init doxygen compatible
Fix typos where appropriate
Update license/copyright
2014-12-02 15:50:58 +08:00
Pieter Wuille 57be955ba0 Remove -printblock, -printblocktree, and -printblockindex 2014-11-27 09:50:20 +01:00
Jonas Schnelli 5dc713bfc7 [REST] set REST API behind "-rest" option 2014-11-26 13:53:27 +01:00
Wladimir J. van der Laan 397b9011c9
Merge pull request #5241
a206950 Introduce separate flushing modes (Pieter Wuille)
51ce901 Improve chainstate/blockindex disk writing policy (Pieter Wuille)
2014-11-25 12:18:00 +01:00
Pieter Wuille 51ce901aa3 Improve chainstate/blockindex disk writing policy
There are 3 pieces of data that are maintained on disk. The actual block
and undo data, the block index (which can refer to positions on disk),
and the chainstate (which refers to the best block hash).

Earlier, there was no guarantee that blocks were written to disk before
block index entries referring to them were written. This commit introduces
dirty flags for block index data, and delays writing entries until the actual
block data is flushed.

With this stricter ordering in writes, it is now safe to not always flush
after every block, so there is no need for the IsInitialBlockDownload()
check there - instead we just write whenever enough time has passed or
the cache size grows too large. Also updating the wallet's best known block
is delayed until this is done, otherwise the wallet may end up referring to an
unknown block.

In addition, only do a write inside the block processing loop if necessary
(because of cache size exceeded). Otherwise, move the writing to a point
after processing is done, after relaying.
2014-11-24 15:15:40 +01:00
Gregory Maxwell 3c77714134 Make -proxy set all network types, avoiding a connect leak.
Previously -proxy was not setting the proxy for IsLimited networks, so
 if you set your configuration to be onlynet=tor you wouldn't get an
 IPv4 proxy set.

The payment protocol gets its proxy configuration from the IPv4 proxy,
 and so it would experience a connection leak.

This addresses issue #5355 and also clears up a cosmetic bug where
 getinfo proxy output shows nothing when onlynet=tor is set.
2014-11-23 15:17:11 -08:00
Philip Kaufmann 1b2600a13a
Change MIT/X11 to MIT in license displayed in the program 2014-11-21 17:03:59 +01:00
Cozz Lovan c1c9d5b415 [Qt] Add Smartfee to GUI 2014-11-19 16:04:53 +01:00
Wladimir J. van der Laan 0c7862e968
Merge pull request #5161
845c86d Do not use third party services for IP detection. (Gregory Maxwell)
2014-11-12 18:35:45 +01:00
Gregory Maxwell 845c86d128 Do not use third party services for IP detection.
This is a simplified re-do of closed pull #3088.

This patch eliminates the privacy and reliability problematic use
of centralized web services for discovering the node's addresses
for advertisement.

The Bitcoin protocol already allows your peers to tell you what
IP they think you have, but this data isn't trustworthy since
they could lie. So the challenge is using it without creating a
DOS vector.

To accomplish this we adopt an approach similar to the one used
by P2Pool: If we're announcing and don't have a better address
discovered (e.g. via UPNP) or configured we just announce to
each peer the address that peer told us. Since peers could
already replace, forge, or drop our address messages this cannot
create a new vulnerability... but if even one of our peers is
giving us a good address we'll eventually make a useful
advertisement.

We also may randomly use the peer-provided address for the
daily rebroadcast even if we otherwise have a seemingly routable
address, just in case we've been misconfigured (e.g. by UPNP).

To avoid privacy problems, we only do these things if discovery
is enabled.
2014-11-07 12:13:46 -08:00
Wladimir J. van der Laan f654f0040b
Change -genproclimit default to 1
This is less surprising.

Avoids the overload-the-CPU default of using N threads for script
verification as well as N threads for generation where N is number of cores.
2014-11-06 08:54:39 +01:00
Wladimir J. van der Laan 9bdec76037
Always log number of threads for script verification
Helps for troubleshooting.
2014-11-06 08:54:34 +01:00
Daniel Kraft af82884ab7 Add "warmup mode" for RPC server.
Start the RPC server before doing all the (expensive) startup
initialisations like loading the block index.  Until the node is ready,
return all calls immediately with a new error signalling "in warmup"
with an appropriate status message (similar to the init message).

This is useful for RPC clients to know that the server is there (e. g.,
they don't have to start it) but not yet available.  It is used in
Namecoin and Huntercoin already for some time, and there exists a UI
hooked onto the RPC interface that actively uses this to its advantage.
2014-11-04 16:01:09 +01:00
Wladimir J. van der Laan 96012e83f1
Merge pull request #5077
2aa6329 Enable customising node policy for datacarrier data size with a -datacarriersize option (Luke Dashjr)
2014-10-31 11:16:09 +01:00
Matt Corallo eadcd0c802 Print parameter interactions to console, too 2014-10-29 19:10:00 -07:00
jtimon eda3733091 MOVEONLY: Move CFeeRate and Amount constants to amount.o 2014-10-27 13:54:37 +01:00
Luke Dashjr 2aa632921e Enable customising node policy for datacarrier data size with a -datacarriersize option 2014-10-27 09:41:57 +00:00
Wladimir J. van der Laan f984c7d7ad
Merge pull request #5108
a873823 CAutoFile: Explicit Get() and remove unused methods (Wladimir J. van der Laan)
fef24ca Add IsNull() to class CAutoFile and remove operator ! (Ruben Dario Ponticeli)
2014-10-22 10:47:14 +02:00
Wladimir J. van der Laan a873823864
CAutoFile: Explicit Get() and remove unused methods
Also add documentation to some methods.
2014-10-22 10:18:19 +02:00
Wladimir J. van der Laan 9acbb4180a
qt: small English language updates from translators
More friendly language, use placeholders where possible
2014-10-21 15:40:43 +02:00
Wladimir J. van der Laan 5f3ea3362a
Merge pull request #5076
c0195b1 Bugfix: Remove default from -zapwallettxes description (inaccurate) (Luke Dashjr)
0a08aa8 Parameterise command line option defaults, so translations are independent of them (Luke Dashjr)
2014-10-21 14:53:55 +02:00
Pieter Wuille a96d113962 Rename CWalletInterface to CValidationInterface
It's useful for much more than wallets.
2014-10-20 10:59:12 -07:00
Pieter Wuille afc32c5eea Fix rebuild-chainstate feature and improve its performance
Previous refactorings broke the ability to rebuild the chainstate by deleting the chainstate
directory, resulting in an incorrect "Incorrect or no genesis block found" error message. Fix
that.

Also, improve the performance of ActivateBestBlockStep by using the skiplist to only discover
a few potential blocks to connect at a time, instead of all blocks forever - as we likely bail
out after connecting a single one anyway.
2014-10-14 15:42:01 -07:00
Luke Dashjr c0195b1c31 Bugfix: Remove default from -zapwallettxes description (inaccurate) 2014-10-14 20:13:44 +00:00
Wladimir J. van der Laan 992ab87114
Merge pull request #4942
9406471 Write fee estimate and peers files only when initialized (Wladimir J. van der Laan)
2014-10-14 11:35:17 +02:00
Luke Dashjr 0a08aa8f2a Parameterise command line option defaults, so translations are independent of them 2014-10-11 08:22:26 +00:00
Pieter Wuille d4a42334d4
Merge pull request #4834
7c70438 Get rid of the dummy CCoinsViewCache constructor arg (Pieter Wuille)
ed27e53 Add coins_tests with a large randomized CCoinViewCache test. (Pieter Wuille)
058b08c Do not keep fully spent but unwritten CCoins entries cached. (Pieter Wuille)
c9d1a81 Get rid of CCoinsView's SetCoins and SetBestBlock. (Pieter Wuille)
f28aec0 Use ModifyCoins instead of mutable GetCoins. (Pieter Wuille)
2014-10-08 14:58:16 -07:00
Wladimir J. van der Laan 6860a55ea0
Merge pull request #4979
de10efd add -timeout default as constant and use them (Philip Kaufmann)
2014-10-08 09:16:19 +02:00
Cozz Lovan 3e61eb9c51 minor txindex documentation improvement 2014-10-06 18:52:51 +02:00
Philip Kaufmann de10efd154 add -timeout default as constant and use them
- update help message text
- simplify code in init to check for -timeout
2014-10-06 13:13:25 +02:00
Pieter Wuille 471d38b015
Merge pull request #4980
20a11ff minor variable init changes in init.cpp (Philip Kaufmann)
2014-10-02 04:29:01 +02:00
Wladimir J. van der Laan 3fd192f8b4
Merge pull request #4234
c122f55 qt: Register CAmount metatype (Wladimir J. van der Laan)
a372168 Use a typedef for monetary values (Mark Friedenbach)
2014-10-01 11:28:55 +02:00
Pieter Wuille bf3a5dd7f0
Merge pull request #4796
e8b5f0d Move CBlockIndex, CChain and related code out of main (jtimon)
6db83db Decouple CChain from mapBlockIndex (jtimon)
2014-09-29 06:06:57 +02:00
Mark Friedenbach a372168e77 Use a typedef for monetary values 2014-09-26 15:42:04 -07:00
Cory Fields eee030f6bc autofile: don't copy CAutoFile by value 2014-09-25 19:25:19 -04:00
Philip Kaufmann 20a11ffabf minor variable init changes in init.cpp
- explicit init of pcoinsdbview and pwalletMain (even if not needed, as
  globals are init to NULL, it seems cleaner)
- remove check if (pwalletMain) in Shutdown() as delete is valid even if
  pwalletMain is NULL
2014-09-25 13:49:49 +02:00
Pieter Wuille 7c70438dc6 Get rid of the dummy CCoinsViewCache constructor arg 2014-09-24 03:19:04 +02:00
Wladimir J. van der Laan d6712db354
Also create pid file in non-daemon mode
Always make a pid file, not only when `-daemon` specified.

This is useful for troubleshooting, for attaching debuggers and loggers
and such.

- Write the pid file only after the datadir lock was acquired
- Don't create or remove a pid file on WIN32, and also don't show the option
2014-09-20 11:03:59 +02:00
Wladimir J. van der Laan 94064710b9 Write fee estimate and peers files only when initialized
Fixes #4669.

Move the loading of addresses to StartNode() to make it more
self-contained.
2014-09-18 14:20:18 +02:00
Pieter Wuille dc54e9db98
Merge pull request #4825
8d657a6 Fixing compiler warning C4800: 'type' forcing value to bool 'true' or 'false' (ENikS)
2014-09-16 04:47:55 +02:00
Pieter Wuille 7388b74cd2
Merge pull request #4911
611116d header include cleanup (Philip Kaufmann)
2014-09-16 04:12:52 +02:00
Pieter Wuille 765f398436
Merge pull request #4875
f7e3637 Eliminate extra assignment (Suhas Daftuar)
ec7eb0f When reindexing check for file before trying to open (refactored) (Suhas Daftuar)
2014-09-16 03:21:21 +02:00
Philip Kaufmann 611116d4e3 header include cleanup
- ensures alphabetical ordering for includes etc. in source file headers
2014-09-14 12:43:56 +02:00
Wladimir J. van der Laan 3fa1c81b94
Merge pull request #4885
aa3c697 Store fewer orphan tx by default, add -maxorphantx option (Gavin Andresen)
c74332c Stricter handling of orphan transactions (Gavin Andresen)
2014-09-11 14:46:27 +02:00
Gavin Andresen aa3c697e90
Store fewer orphan tx by default, add -maxorphantx option
There is no reason to store thousands of orphan transactions;
normally an orphan's parents will either be broadcast or
mined reasonably quickly.

This pull drops the maximum number of orphans from 10,000 down
to 100, and adds a command-line option (-maxorphantx) that is
just like -maxorphanblocks to override the default.
2014-09-10 14:09:40 -04:00
Suhas Daftuar ec7eb0fa80 When reindexing check for file before trying to open (refactored) 2014-09-10 13:51:53 -04:00
Adam Weiss e982b574a5 Use explicit fflush() instead of setvbuf()
Flushing after every line when printing to console is desirable when
running with systemd but setvbuf() has slightly different semantics
on Windows that causes warnings.  Just do an explicit fflush() after
each line print to console instead.
2014-09-10 12:48:13 -04:00
jtimon 6db83db3eb Decouple CChain from mapBlockIndex 2014-09-08 22:14:24 +02:00
ENikS 8d657a6517 Fixing compiler warning C4800: 'type' forcing value to bool 'true' or 'false' 2014-09-06 15:59:59 -04:00
Pieter Wuille 145d5be896 Introduce BlockMap type for mapBlockIndex 2014-09-04 02:04:51 +02:00