Commit Graph

95 Commits

Author SHA1 Message Date
Jorge Timón 381a46e38f
Consensus: Policy: MOVEONLY: Move CFeeRate out of the consensus module
...from amount.o to policy/feerate.o

Policy, because it moves policy code to the policy directory (common module)
2017-05-03 18:00:13 +02:00
Jorge Timón 330bb5a456
Consensus: Minimal way to move dust out of consensus 2017-05-03 17:55:52 +02:00
CryptAxe 94807be8c6
Trivial: fix fee estimate write error log message 2017-04-23 10:36:26 -07:00
Wladimir J. van der Laan 86ea3c2ff2
Merge #10181: Include cleanup
1c897fc Missing includes (Jorge Timón)
a1fd450 Trivial: Remove unneeded includes from .h: (Jorge Timón)

Tree-SHA512: ada3e62cc2435e58172a88b380be371b717a05725956c15e5493b6e19fe2903e5e6e43fd22dc24699333a0e8a0c7b42eb1ae61b41cb4ba82495be18e2d4ef3c6
2017-04-20 23:24:00 +02:00
Jorge Timón 1c897fc3da
Missing includes 2017-04-13 02:31:44 +02:00
Alex Morcos 68af651498 MOVEONLY: move TxConfirmStats to cpp 2017-04-10 13:56:50 -04:00
Alex Morcos 2332f19bef Initialize TxConfirmStats in constructor
and change to storing as a pointer.
2017-04-10 13:56:50 -04:00
Alex Morcos 5ba81e54e0 Read and Write fee estimate file directly from CBlockPolicyEstimator 2017-04-10 13:56:50 -04:00
Alex Morcos 14e10aa842 Call estimate(Smart)Fee directly from CBlockPolicyEstimator 2017-04-10 13:56:50 -04:00
Alex Morcos dbb9e3699b Give CBlockPolicyEstimator it's own lock 2017-04-10 13:51:51 -04:00
Alex Morcos f6187d6e39 Make processBlockTx private. 2017-04-10 13:51:51 -04:00
Gregory Maxwell 6b3bb3d9ba Change LogAcceptCategory to use uint32_t rather than sets of strings.
This changes the logging categories to boolean flags instead of strings.

This simplifies the acceptance testing by avoiding accessing a scoped
 static thread local pointer to a thread local set of strings.  It
 eliminates the only use of boost::thread_specific_ptr outside of
 lockorder debugging.

This change allows log entries to be directed to multiple categories
 and makes it easy to change the logging flags at runtime (e.g. via
 an RPC, though that isn't done by this commit.)

It also eliminates the fDebug global.

Configuration of unknown logging categories now produces a warning.
2017-04-01 18:53:29 +00:00
Wladimir J. van der Laan 47510ad3dd
Merge #9548: Remove min reasonable fee
ad82cb0 Remove unnecessary min fee argument in CTxMemPool constructor (Alex Morcos)
2a7b56c CBlockPolicyEstimator now uses hard coded minimum bucket feerate (Alex Morcos)
ac9d3d2 Change fee estimation bucket limit variable names (Alex Morcos)

Tree-SHA512: 6e3bc7df3497ed60c7620845d222063e33a0238020f5c3316e61e0eff758078588ea8dd51196ceb59aa561ba106f8cdae62cebe521adb3247108bb49f15252d6
2017-03-07 19:49:00 +01:00
Alex Morcos fe282acd76 [cleanup] Remove estimatePriority and estimateSmartPriority
Unused everywhere now except one test.
2017-02-27 11:23:51 -05:00
Alex Morcos 272b25a6a9 [mining] Remove -blockprioritysize.
Remove ability of mining code to fill part of a block with transactions sorted by coin age.
2017-02-27 11:23:50 -05:00
Alex Morcos bc8fd12289 Remove harmless read of unusued priority estimates 2017-02-21 11:12:44 -05:00
Alex Morcos 2a7b56cc0e CBlockPolicyEstimator now uses hard coded minimum bucket feerate 2017-01-17 13:21:31 -05:00
Alex Morcos ac9d3d25f7 Change fee estimation bucket limit variable names 2017-01-17 13:19:32 -05:00
Wladimir J. van der Laan dd98f04538
Merge #9380: Separate different uses of minimum fees
eb30d1a Introduce -dustrelayfee (Alex Morcos)
7b1add3 Introduce -incrementalrelayfee (Alex Morcos)
daec955 Introduce -blockmintxfee (Alex Morcos)
2017-01-16 19:33:08 +01:00
Alex Morcos eb30d1a5b2 Introduce -dustrelayfee 2017-01-16 08:40:40 -05:00
Alex Morcos 7b1add3c28 Introduce -incrementalrelayfee 2017-01-16 08:39:03 -05:00
Alex Morcos daec955fd6 Introduce -blockmintxfee 2017-01-04 13:24:19 -05:00
Alex Morcos 44b64b933d Fix edge case with stale fee estimates 2017-01-04 12:10:18 -05:00
Alex Morcos 78ae62d264 Add clarifying comments to fee estimation 2017-01-04 12:10:18 -05:00
Alex Morcos 5fe0f47aa7 Add extra logging to processBlock in fee estimation. 2017-01-04 12:10:18 -05:00
Alex Morcos ebafdcabb1 Pass pointers to existing CTxMemPoolEntries to fee estimation 2017-01-04 12:09:34 -05:00
Alex Morcos d825838e64 Always update fee estimates on new blocks.
All decisions about whether the transactions are valid data points are made at the time the transaction arrives. Updating on blocks all the time will now cause stale fee estimates to decay quickly when we restart a node.
2017-01-04 12:09:34 -05:00
Alex Morcos 6f06b268c1 rename bool to validFeeEstimate 2017-01-04 12:09:33 -05:00
Alex Morcos 84f7ab08d2 Remove member variable hadNoDependencies from CTxMemPoolEntry
Fee estimation can just check its own mapMemPoolTxs to determine the same information.  Note that now fee estimation for block processing must happen before those transactions are removed, but this shoudl be a speedup.
2017-01-04 12:09:33 -05:00
Alex Morcos 4df44794c9 Remove extraneous LogPrint from fee estimation
Once priority estimation was removed, not all transactions in the mempool are tracked in the fee estimation mempool tracking.  So there is no error if a transaction is not found for removal.
2017-01-04 12:03:44 -05:00
Wladimir J. van der Laan 1ce7ede2a9
Merge #9288: Fix a bug if the min fee is 0 for FeeFilterRounder
f8d43b8 Avoid rollingMinimumFeeRate never being able to decay below half (Alex Morcos)
eab8e1b fix a bug if the min fee is 0 for FeeFilterRounder (Alex Morcos)
2017-01-04 12:33:56 +01:00
isle2983 27765b6403 Increment MIT Licence copyright header year on files modified in 2016
Edited via:

$ contrib/devtools/copyright_header.py update .
2016-12-31 11:01:21 -07:00
Alex Morcos eab8e1b172 fix a bug if the min fee is 0 for FeeFilterRounder 2016-12-08 15:40:14 -05:00
Pieter Wuille f6fb7acda4 Move CTxInWitness inside CTxIn 2016-12-04 23:47:12 -08:00
Pieter Wuille 2efcfa5acf
Merge #9260: Mrs Peacock in The Library with The Candlestick (killed main.{h,cpp})
76faa3c Rename the remaining main.{h,cpp} to validation.{h,cpp} (Matt Corallo)
e736772 Move network-msg-processing code out of main to its own file (Matt Corallo)
87c35f5 Remove orphan state wipe from UnloadBlockIndex. (Matt Corallo)
2016-12-02 18:25:40 -08:00
Matt Corallo 76faa3cdfe Rename the remaining main.{h,cpp} to validation.{h,cpp} 2016-12-02 09:42:51 -08:00
Alex Morcos d824ad030e Disable fee estimates for a confirm target of 1 block 2016-11-29 12:18:44 -05:00
Brian Deery 07ede5d711 update comments for tx weight 2016-11-14 00:38:07 -06:00
fanquake d8edf03db7
Remove unused var UNLIKELY_PCT from fees.h 2016-11-09 17:51:27 +08:00
Wladimir J. van der Laan 3c03dc2cfc
Merge #7730: Remove priority estimation
0bd581a add release notes for removal of priority estimation (Alex Morcos)
b2322e0 Remove priority estimation (Alex Morcos)
2016-11-07 13:36:40 +01:00
Alex Morcos b2322e0fc6 Remove priority estimation 2016-11-07 13:22:34 +01:00
isle2983 4b04e32c20 [copyright] copyright header style uniform
Three categories of modifications:

1)

1 instance of 'The Bitcoin Core developers \n',
1 instance of 'the Bitcoin Core developers\n',
3 instances of 'Bitcoin Core Developers\n', and
12 instances of 'The Bitcoin developers\n'

are made uniform with the 443 instances of 'The Bitcoin Core developers\n'

2)

3 instances of 'BitPay, Inc\.\n' are made uniform with the other 6
instances of 'BitPay Inc\.\n'

3)

4 instances where there was no '(c)' between the 'Copyright' and the year
where it deviates from the style of the local directory.
2016-11-06 10:12:50 -07:00
Wladimir J. van der Laan cdfb7755a6
Merge #8914: Kill insecure_random and associated global state
5eaaa83 Kill insecure_random and associated global state (Wladimir J. van der Laan)
2016-10-18 15:44:57 +02:00
Wladimir J. van der Laan 5eaaa83ac1 Kill insecure_random and associated global state
There are only a few uses of `insecure_random` outside the tests.
This PR replaces uses of insecure_random (and its accompanying global
state) in the core code with an FastRandomContext that is automatically
seeded on creation.

This is meant to be used for inner loops. The FastRandomContext
can be in the outer scope, or the class itself, then rand32() is used
inside the loop. Useful e.g. for pushing addresses in CNode or the fee
rounding, or randomization for coin selection.

As a context is created per purpose, thus it gets rid of
cross-thread unprotected shared usage of a single set of globals, this
should also get rid of the potential race conditions.

- I'd say TxMempool::check is not called enough to warrant using a special
  fast random context, this is switched to GetRand() (open for
  discussion...)

- The use of `insecure_rand` in ConnectThroughProxy has been replaced by
  an atomic integer counter. The only goal here is to have a different
  credentials pair for each connection to go on a different Tor circuit,
  it does not need to be random nor unpredictable.

- To avoid having a FastRandomContext on every CNode, the context is
  passed into PushAddress as appropriate.

There remains an insecure_random for test usage in `test_random.h`.
2016-10-17 13:08:35 +02:00
Johnson Lau 4c0c25a604 Require compressed keys in segwit as policy and disable signing with uncompressed keys for segwit scripts 2016-10-16 23:53:35 +08:00
Johnson Lau 3ade2f64cf Add standard limits for P2WSH with tests 2016-10-16 23:53:35 +08:00
Johnson Lau e41bd449ab Add policy: null signature for failed CHECK(MULTI)SIG 2016-09-27 23:40:59 +08:00
Johnson Lau c72c5b1e3b Make non-minimal OP_IF/NOTIF argument non-standard for P2WSH 2016-09-23 13:07:38 +08:00
Wladimir J. van der Laan 4b1a4d8810
Merge #8381: Make witness v0 outputs non-standard
c59c434 qa: Add test for standardness of segwit v0 outputs (Suhas Daftuar)
1ffaff2 Make witness v0 outputs non-standard before segwit activation (Johnson Lau)
2016-07-26 14:24:11 +02:00
Suhas Daftuar c59c434b7d qa: Add test for standardness of segwit v0 outputs 2016-07-23 00:01:02 +08:00