Commit graph

471 commits

Author SHA1 Message Date
Wladimir J. van der Laan 49d57125f9
qt: Ignore showNormalIfMinimized in initialization or shutdown
Also get rid of ui_interface flag NOSHOWGUI. It's up to the GUI to
decide this.

Fixes #4360.
2014-07-14 10:49:12 +02:00
Wladimir J. van der Laan c9bc398ad9
Merge pull request #4378
dc942e6 Introduce whitelisted peers. (Pieter Wuille)
2014-07-14 10:23:39 +02:00
Zak Wilcox a7e1d503c4 In -? output: -keypool, -gen, -genproclimit depend on ENABLE_WALLET 2014-07-12 06:43:41 +01:00
Pieter Wuille dc942e6f27 Introduce whitelisted peers.
This adds a -whitelist option to specify subnet ranges from which peers
that connect are whitelisted. In addition, there is a -whitebind option
which works like -bind, except peers connecting to it are also
whitelisted (allowing a separate listen port for trusted connections).

Being whitelisted has two effects (for now):
* They are immune to DoS disconnection/banning.
* Transactions they broadcast (which are valid) are always relayed,
  even if they were already in the mempool. This means that a node
  can function as a gateway for a local network, and that rebroadcasts
  from the local network will work as expected.

Whitelisting replaces the magic exemption localhost had for DoS
disconnection (local addresses are still never banned, though), which
implied hidden service connects (from a localhost Tor node) were
incorrectly immune to DoS disconnection as well. This old
behaviour is removed for that reason, but can be restored using
-whitelist=127.0.0.1 or -whitelist=::1 can be specified. -whitebind
is safer to use in case non-trusted localhost connections are expected
(like hidden services).
2014-07-09 20:40:14 +02:00
Philip Kaufmann 00d1980b8f init.cpp: log fee estimates filename on error
- small changes to Shutdown(), buffer __func__, which is now used in
  all LogPrintf() calls and format for better readability
- order using namespace alpabetically
2014-07-09 09:22:36 +02:00
Cozz Lovan d88af56011 Fee fixes 2014-07-08 05:09:19 +02:00
Wladimir J. van der Laan 4252f2928b
Merge pull request #4327
a339a37 error out, when we detect -socks argument (Philip Kaufmann)
0127a9b remove SOCKS4 support from core and GUI (Philip Kaufmann)
2014-07-07 12:45:28 +02:00
Wladimir J. van der Laan 73ac7abd08 Move ui_interface to bitcoin_server.a
There is no need for it in the utility libraries or tools.
Put it in init.cpp, and in the tests separately (as they can't link init).
2014-07-07 09:58:56 +02:00
Philip Kaufmann a339a37b28 error out, when we detect -socks argument 2014-07-07 08:15:14 +02:00
Philip Kaufmann 0127a9be14 remove SOCKS4 support from core and GUI
- now we support SOCKS5 only
2014-07-07 08:15:14 +02:00
Wladimir J. van der Laan 00fa78c35b
Merge pull request #3764
2e36866 Show nodeid instead of addresses (for anonymity) unless otherwise requested. (R E Broadley)
2014-07-04 08:04:30 +02:00
Wladimir J. van der Laan e61c6d69ad
Merge pull request #4450
0da6b3f Remove signal DoubleSpendDetected, use function (Tom Harding)
88dd359 Check signatures before respend relay (Tom Harding)
2014-07-04 05:50:53 +02:00
R E Broadley 2e36866fec Show nodeid instead of addresses (for anonymity) unless otherwise requested. 2014-07-04 09:38:44 +07:00
Gavin Andresen 13fc83c77b
Move fee policy out of core 2014-07-03 14:42:16 -04:00
Gavin Andresen b33d1f5ee5
Use fee/priority estimates in wallet CreateTransaction
The wallet now uses the mempool fee estimator with a new
command-line option: -txconfirmtarget (default: 1) instead
of using hard-coded fees or priorities.

A new bitcoind that hasn't seen enough transactions to estimate
will fall back to the old hard-coded minimum priority or
transaction fee.

-paytxfee option overrides -txconfirmtarget.

Relaying and mining code isn't changed.

For Qt, the coin control dialog now uses priority estimates to
label transaction priority (instead of hard-coded constants);
unspent outputs were consistently labeled with a much higher
priority than is justified by the free transactions actually
being accepted into blocks.

I did not implement any GUI for setting -txconfirmtarget; I would
suggest getting rid of the "Pay transaction fee" GUI and replace
it with either "target number of confirmations" or maybe
a "faster confirmation <--> lower fee" slider or select box.
2014-07-03 13:44:33 -04:00
Wladimir J. van der Laan 4278b1df45
Clarify error message when invalid -rpcallowip
Also add to HelpMessage() what specifications are valid.
2014-07-03 07:11:59 +02:00
Tom Harding 0da6b3fd18 Remove signal DoubleSpendDetected, use function
Also removes the need for forward reference to RelayableRespend.
2014-07-02 09:27:29 -07:00
Wladimir J. van der Laan b29b509612
Merge pull request #4325
4aaa017 rework help messages for fee-related options (Philip Kaufmann)
2014-07-01 12:55:33 +02:00
Tom Harding 9004798e62 Add -respendnotify option and new RPC data
-respendnotify=<cmd> Execute command when a network tx respends wallet
tx input (%s=respend TxID, %t=wallet TxID)

Add respendsobserved array to gettransaction, listtransactions, and
listsinceblock RPCs.  This omits the malleated clones that are included
in the walletconflicts array.

Add RPC help for respendsobserved and walletconflicts (help was missing
for the latter).
2014-06-27 07:54:21 -07:00
Tom Harding d640a3ceab Relay double-spends, subject to anti-DOS
Allows network wallets and other clients to see transactions that respend
a prevout already spent in an unconfirmed transaction in this node's mempool.

Knowledge of an attempted double-spend is of interest to recipients of the
first spend.  In some cases, it will allow these recipients to withhold
goods or services upon being alerted of a double-spend that deprives them
of payment.

As before, respends are not added to the mempool.

Anti-Denial-of-Service-Attack provisions:
 - Use a bloom filter to relay only one respend per mempool prevout
 - Rate-limit respend relays to a default of 100 thousand bytes/minute
 - Define tx2.IsEquivalentTo(tx1): equality when scriptSigs are not considered
 - Do not relay these equivalent transactions

Remove an unused variable declaration in txmempool.cpp.
2014-06-27 07:54:21 -07:00
Luke Dashjr e44fea55ea Add an option to allow users to disable relaying/mining data carrier transactions 2014-06-26 14:31:06 +00:00
Wladimir J. van der Laan 0410d11b3a
Merge pull request #4130
1c750db remove -tor compatibility code (only allow -onion) (Philip Kaufmann)
2014-06-24 17:51:32 +02:00
Wladimir J. van der Laan d4392c8989
Merge pull request #3674
77cbd46 Let -zapwallettxes recover transaction meta data (Cozz Lovan)
2014-06-24 17:04:52 +02:00
Philip Kaufmann 1c750dbd40 remove -tor compatibility code (only allow -onion)
- exit, if -tor option is found and give error to user
2014-06-24 16:07:20 +02:00
Cory Fields f3967bcc50 build: fix build weirdness after 54372482.
bitcoin-config.h moved, but the old file is likely to still exist when
reconfiguring or switching branches. This would've caused files to not rebuild
correctly, and other strange problems.

Make the path explicit so that the old one cannot be found.

Core libs use config/bitcoin-config.h.

Libs (like crypto) which don't want access to bitcoin's headers continue
to use -Iconfig and #include bitcoin-config.h.
2014-06-23 14:04:38 -04:00
Pieter Wuille cf0c47b269 Remove getwork() RPC call 2014-06-21 19:47:39 +02:00
Wladimir J. van der Laan b8e56aa8ef
Merge pull request #4339
92a6220 sanity: hook up sanity checks (Cory Fields)
679240d sanity: add libc/stdlib sanity checks (Cory Fields)
11404af sanity: autoconf check for sys/select.h (Cory Fields)
2014-06-18 09:52:50 +02:00
Wladimir J. van der Laan 5694d10781
Merge pull request #4346
1569353 Add `-stopafterblockimport` option (Wladimir J. van der Laan)
2014-06-17 14:51:15 +02:00
Philip Kaufmann 1020f599f3 add comment to HelpMessage() to ensure alphabetical ordering
- also rename hmm to mode, to be consistent between .h and .cpp
2014-06-17 09:17:12 +02:00
Cory Fields 92a6220711 sanity: hook up sanity checks 2014-06-16 17:21:34 -04:00
Cozz Lovan 77cbd4623e Let -zapwallettxes recover transaction meta data 2014-06-16 18:56:57 +02:00
Wladimir J. van der Laan 1569353b8a
Add -stopafterblockimport option
Stop after importing blocks. This can be useful for development
and trouble shooting.
2014-06-16 11:47:32 +02:00
Wladimir J. van der Laan 45615af26f Add 'about' information to -version output
Adds a copyright and attribution message to the `-version` output
(the same as shown in the About dialog in the GUI).

Move the message to a function LicenseInfo in init.cpp.
2014-06-12 16:11:56 +02:00
Philip Kaufmann 4aaa01783d rework help messages for fee-related options
- mention the units and show the default for -paytxfee
2014-06-11 12:16:26 +02:00
Philip Kaufmann 56b07d2dcd [Qt] allow setting listen via GUI
- add DEFAULT_LISTEN in net.h and use in the code (shared
  setting between core and GUI)

Important: This makes it obvious, that we need to re-think the
settings/options handling, as GUI settings are processed before
any parameter-interaction (which is mostly important for network
stuff) in AppInit2()!
2014-06-11 12:04:17 +02:00
Wladimir J. van der Laan d01574f792
Merge pull request #4277
4a09e1d key.cpp: fail with a friendlier message on missing ssl EC support (Andrew Poelstra)
2014-06-11 08:34:25 +02:00
Wladimir J. van der Laan 62fdf381fa
Merge pull request #3824
f0a83fc Use Params().NetworkID() instead of TestNet() from the payment protocol (jtimon)
2871889 net.h was using std namespace through chainparams.h included in protocol.h (jtimon)
c8c52de Replace virtual methods with static attributes, chainparams.h depends on protocol.h instead of the other way around (jtimon)
a3d946e Get rid of TestNet() (jtimon)
6fc0fa6 Add RPCisTestNet chain parameter (jtimon)
cfeb823 Add RequireStandard chain parameter (jtimon)
21913a9 Add AllowMinDifficultyBlocks chain parameter (jtimon)
d754f34 Move majority constants to chainparams (jtimon)
8d26721 Get rid of RegTest() (jtimon)
cb9bd83 Add DefaultCheckMemPool chain parameter (jtimon)
2595b9a Add DefaultMinerThreads chain parameter (jtimon)
bfa9a1a Add MineBlocksOnDemand chain parameter (jtimon)
1712adb Add MiningRequiresPeers chain parameter (jtimon)
2014-06-09 12:52:29 +02:00
Gavin Andresen 171ca7745e estimatefee / estimatepriority RPC methods
New RPC methods: return an estimate of the fee (or priority) a
transaction needs to be likely to confirm in a given number of
blocks.

Mike Hearn created the first version of this method for estimating fees.
It works as follows:

For transactions that took 1 to N (I picked N=25) blocks to confirm,
keep N buckets with at most 100 entries in each recording the
fees-per-kilobyte paid by those transactions.

(separate buckets are kept for transactions that confirmed because
they are high-priority)

The buckets are filled as blocks are found, and are saved/restored
in a new fee_estiamtes.dat file in the data directory.

A few variations on Mike's initial scheme:

To estimate the fee needed for a transaction to confirm in X buckets,
all of the samples in all of the buckets are used and a median of
all of the data is used to make the estimate. For example, imagine
25 buckets each containing the full 100 entries. Those 2,500 samples
are sorted, and the estimate of the fee needed to confirm in the very
next block is the 50'th-highest-fee-entry in that sorted list; the
estimate of the fee needed to confirm in the next two blocks is the
150'th-highest-fee-entry, etc.

That algorithm has the nice property that estimates of how much fee
you need to pay to get confirmed in block N will always be greater
than or equal to the estimate for block N+1. It would clearly be wrong
to say "pay 11 uBTC and you'll get confirmed in 3 blocks, but pay
12 uBTC and it will take LONGER".

A single block will not contribute more than 10 entries to any one
bucket, so a single miner and a large block cannot overwhelm
the estimates.
2014-06-06 10:44:57 -04:00
Gavin Andresen c6cb21d17a Type-safe CFeeRate class
Use CFeeRate instead of an int64_t for quantities that are
fee-per-size.

Helps prevent unit-conversion mismatches between the wallet,
relaying, and mining code.
2014-06-06 10:34:18 -04:00
Wladimir J. van der Laan 7d4dda7630 Remove global strWalletFile
As it says on the tin. There is no need to have this variable be
global, it's only used in AppInit2.
2014-06-05 14:52:34 +02:00
Philip Kaufmann 5bd02cf715 log used config file to debug.log on startup 2014-06-04 21:19:22 +02:00
Jeff Garzik c79897af31 Merge pull request #4247 from Diapolo/listen
rename fNoListen to fListen and move to net
2014-06-04 15:00:38 -04:00
Wladimir J. van der Laan f0f4904bec
Merge pull request #4258
7b45d94 Make max number of orphan blocks kept in memory a startup parameter (fixes #4253) (shshshsh)
2014-06-04 19:30:44 +02:00
shshshsh 7b45d943b2 Make max number of orphan blocks kept in memory a startup parameter (fixes #4253) 2014-06-04 11:58:18 +00:00
jtimon cb9bd83bba Add DefaultCheckMemPool chain parameter 2014-06-04 13:29:35 +02:00
Andrew Poelstra 4a09e1df51
key.cpp: fail with a friendlier message on missing ssl EC support
Previously if bitcoind is linked with an OpenSSL which is compiled
without EC support, this is seen as an assertion failure "pKey !=
NULL" at key.cpp:134, which occurs after several seconds. It is an
esoteric piece of knowledge to interpret this as "oops, I linked
with the wrong OpenSSL", and because of the delay it may not even
be noticed.

The new output is

: OpenSSL appears to lack support for elliptic curve cryptography. For
more information, visit
https://en.bitcoin.it/wiki/OpenSSL_and_EC_Libraries
: Initialization sanity check failed. Bitcoin Core is shutting down.

which occurs immediately after attempted startup.

This also blocks in an InitSanityCheck() function which currently only
checks for EC support but should eventually do more. See #4081.
2014-06-03 12:09:51 -07:00
Cozz Lovan 06a91d9698 VerifyDB progress 2014-06-03 15:21:47 +02:00
Philip Kaufmann 53a088154c rename fNoListen to fListen and move to net
- better code readability and it belongs to net
- this is a prerequisite for a pull to add -listen to the GUI
2014-05-29 14:01:39 +02:00
R E Broadley 79d06dc6e0 Remove redundant c_str 2014-05-22 00:23:03 +07:00
Wladimir J. van der Laan deb3572ab1 Add -rpcbind option to allow binding RPC port on a specific interface
Add -rpcbind command option to specify binding RPC service on one
or multiple specific interfaces.

Functionality if -rpcbind is not specified remains the same as before:

- If no -rpcallowip specified, bind on localhost
- If no -rpcbind specified, bind on any interface

Implements part of #3111.
2014-05-13 07:23:23 +02:00