aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
AgeCommit message (Collapse)Author
2015-11-28Merge pull request #7106Gregory Maxwell
a9f3d3d Fix and improve relay from whitelisted peers (Pieter Wuille)
2015-11-28Merge pull request #6508Pieter Wuille
eece63f Switch blocks to a constant-space Merkle root/branch algorithm. (Pieter Wuille) ee60e56 Add merkle.{h,cpp}, generic merkle root/branch algorithm (Pieter Wuille)
2015-11-28[trivial] Reuse translation and cleanup DEFAULT_* valuesMarcoFalke
* DEFAULT_DISABLE_SAFEMODE = false * Use DEFAULT_* constants for extern bools
2015-11-28Constrain constant values to a single location in codeLuke Dashjr
2015-11-27Switch blocks to a constant-space Merkle root/branch algorithm.Pieter Wuille
This switches the Merkle tree logic for blocks to one that runs in constant (small) space. The old code is moved to tests, and a new test is added that for various combinations of block sizes, transaction positions to compute a branch for, and mutations: * Verifies that the old code and new code agree for the Merkle root. * Verifies that the old code and new code agree for the Merkle branch. * Verifies that the computed Merkle branch is valid. * Verifies that mutations don't change the Merkle root. * Verifies that mutations are correctly detected.
2015-11-27Merge pull request #7053Wladimir J. van der Laan
2e29e7e Globals: Remove a bunch of Params() calls from main.cpp: (Jorge Timón)
2015-11-27Merge pull request #6871Wladimir J. van der Laan
63b5840 Fix usage of local python-bitcoinlib (Peter Todd) 16a2f93 Fix incorrect locking of mempool during RBF replacement (Peter Todd) 97203f5 Port test to rpc-test framework (Suhas Daftuar) 20367d8 Add test for max replacement limit (Suhas Daftuar) 73d9040 Improve RBF replacement criteria (Suhas Daftuar) b272ecf Reject replacements that add new unconfirmed inputs (Peter Todd) fc8c19a Prevent low feerate txs from (directly) replacing high feerate txs (Peter Todd) 0137e6f Add tests for transaction replacement (Peter Todd) 5891f87 Add opt-in full-RBF to mempool (Peter Todd)
2015-11-26Fix and improve relay from whitelisted peersPieter Wuille
This makes sure that retransmits by a whitelisted peer also actually result in a retransmit. Further, this changes the logic to never relay in case we would assign a DoS score, as we expect to get DoS banned ourselves as a result.
2015-11-24Add enforcenodebloom option.Patick Strateman
Previously peers which implement a protocol version less than NO_BLOOM_VERSION would not be disconnected for sending a filter command, regardless of the peerbloomfilter option. Many node operators do not wish to provide expensive bloom filtering for SPV clients, previously they had to cherry pick the commit which enabled the disconnect logic. The default should remain false until a sufficient percent of SPV clients have updated.
2015-11-24Move bloom filter filtering logic outside of command "switch" (giant if/else).Patick Strateman
Moving this logic outside of the "switch" makes it far simpler to enable the forced disconnect by a parameter.
2015-11-23Globals: Remove a bunch of Params() calls from main.cpp:Jorge Timón
1) Chainparams: Explicit CChainParams arg for main: -AcceptBlock -AcceptBlockHeader -ActivateBestChain -ConnectTip -InitBlockIndex -LoadExternalBlockFile -VerifyDB parametric constructor 2) Also pickup more Params()\. in main.cpp 3) Pass nPruneAfterHeight explicitly to new FindFilesToPrune() in main.cpp
2015-11-18Merge pull request #6932Wladimir J. van der Laan
1cf3dd8 Add unit test for UpdateCoins (Alex Morcos) 03c8282 Make CCoinsViewTest behave like CCoinsViewDB (Alex Morcos) 14470f9 ModifyNewCoins saves database lookups (Alex Morcos)
2015-11-17Fix debug log message for block filesAlex Morcos
2015-11-16Merge pull request #6986Gregory Maxwell
6bc9e40 Chainparams: Explicit CChainParams arg for miner: (Jorge Timón) 598e494 Chainparams: Explicit CChainParams arg for main (pre miner): (Jorge Timón)
2015-11-15Fixed integer comparison warning.Eric Lombrozo
2015-11-14Merge pull request #6993Gregory Maxwell
bbf49da Fix comment for blocksonly parameter interactions (Patick Strateman) 6a4982f Fix fRelayTxs comment (Patick Strateman) 59441a0 Display DEFAULT_WHITELISTALWAYSRELAY in help text (Patick Strateman) 71a2683 Use DEFAULT_BLOCKSONLY and DEFAULT_WHITELISTALWAYSRELAY constants (Patick Strateman) 762b13b Add help text for blocksonly and whitelistalwaysrelay (Patick Strateman) 3a96497 Add whitelistalwaysrelay option (Patick Strateman) 420fa81 Do not process tx inv's in blocksonly mode (Patick Strateman) 4044f07 Add blocksonly mode (Patick Strateman)
2015-11-14Use DEFAULT_BLOCKSONLY and DEFAULT_WHITELISTALWAYSRELAY constantsPatick Strateman
2015-11-14Add whitelistalwaysrelay optionPatick Strateman
2015-11-14Do not process tx inv's in blocksonly modePatick Strateman
2015-11-13Clarify nLockTime-by-time comment in CheckFinalTx()Peter Todd
2015-11-13don't enforce maxuploadtargets disconnect for whitelisted peersJonas Schnelli
2015-11-12Merge pull request #6639Wladimir J. van der Laan
58ef0ff doc: update docs for Tor listening (Wladimir J. van der Laan) 68ccdc4 doc: Mention Tor listening in release notes (Wladimir J. van der Laan) 09c1ae1 torcontrol improvements and fixes (Wladimir J. van der Laan) 2f796e5 Better error message if Tor version too old (Peter Todd) 8f4e67f net: Automatically create hidden service, listen on Tor (Wladimir J. van der Laan)
2015-11-12Merge pull request #6918Wladimir J. van der Laan
69d373f Don't wipe the sigcache in TestBlockValidity (Pieter Wuille) 0b9e9dc Evict sigcache entries that are seen in a block (Pieter Wuille) 830e3f3 Make sigcache faster and more efficient (Pieter Wuille)
2015-11-12Merge pull request #6931Pieter Wuille
33c90cf Make skipping BIP30 check chain agnostic (Alex Morcos) 06d81ad Skip BIP30 check after BIP34 activation (Alex Morcos)
2015-11-11Merge pull request #6974Wladimir J. van der Laan
40b77d4 Always allow getheaders from whitelisted peers (Wladimir J. van der Laan)
2015-11-11Chainparams: Explicit CChainParams arg for main (pre miner):Jorge Timón
-ProcessNewBlock -TestBlockValidity
2015-11-11Merge pull request #6982Wladimir J. van der Laan
7267843 Globals: Make AcceptBlockHeader static (Fix #6163) (Jorge Timón)
2015-11-11Globals: Make AcceptBlockHeader static (Fix #6163)Jorge Timón
..and at the same time prevent AcceptBlockHeader() from calling global function Params()
2015-11-10Fix incorrect locking of mempool during RBF replacementPeter Todd
Previously RemoveStaged() was called without pool.cs held.
2015-11-10Improve RBF replacement criteriaSuhas Daftuar
Fix the calculation of conflicting size/conflicting fees.
2015-11-10Reject replacements that add new unconfirmed inputsPeter Todd
2015-11-10Prevent low feerate txs from (directly) replacing high feerate txsPeter Todd
Previously all conflicting transactions were evaluated as a whole to determine if the feerate was being increased. This meant that low feerate children pulled the feerate down, potentially allowing a high transaction with a high feerate to be replaced by one with a lower feerate.
2015-11-10Add opt-in full-RBF to mempoolPeter Todd
Replaces transactions already in the mempool if a new transaction seen with a higher fee, specifically both a higher fee per KB and a higher absolute fee. Children are evaluateed for replacement as well, using the mempool package tracking to calculate replaced fees/size. Transactions can opt-out of transaction replacement by setting nSequence >= maxint-1 on all inputs. (which all wallets do already)
2015-11-10Merge pull request #6965Wladimir J. van der Laan
77f1f59 Benchmark sanity checks and fork checks in ConnectBlock (Matt Corallo)
2015-11-10net: Automatically create hidden service, listen on TorWladimir J. van der Laan
Starting with Tor version 0.2.7.1 it is possible, through Tor's control socket API, to create and destroy 'ephemeral' hidden services programmatically. https://stem.torproject.org/api/control.html#stem.control.Controller.create_ephemeral_hidden_service This means that if Tor is running (and proper authorization is available), bitcoin automatically creates a hidden service to listen on, without user manual configuration. This will positively affect the number of available .onion nodes. - When the node is started, connect to Tor through control socket - Send `ADD_ONION` command - First time: - Make it create a hidden service key - Save the key in the data directory for later usage - Make it redirect port 8333 to the local port 8333 (or whatever port we're listening on). - Keep control socket connection open for as long node is running. The hidden service will (by default) automatically go away when the connection is closed.
2015-11-10Merge pull request #6822Wladimir J. van der Laan
e20d924 [trivial] init: Use defaults MIN_RELAY_TX_FEE & TRANSACTION_MAXFEE (MarcoFalke) 536766c [trivial] New DEFAULT_MIN_RELAY_TX_FEE = 1000 (MarcoFalke) 5f46a7d transaction_tests: Be more strict checking dust (MarcoFalke)
2015-11-10Merge pull request #6163Wladimir J. van der Laan
87cbdb8 Globals: Explicit Consensus::Params arg for main: (Jorge Timón)
2015-11-09[trivial] New DEFAULT_MIN_RELAY_TX_FEE = 1000MarcoFalke
2015-11-09Always allow getheaders from whitelisted peersWladimir J. van der Laan
Process `getheaders` messages from whitelisted peers even if we are in initial block download. Whitelisted peers can always use a node as a block source. Also log a debug message when the request is ignored, for troubleshooting. Fixes #6971.
2015-11-06Benchmark sanity checks and fork checks in ConnectBlockMatt Corallo
2015-11-05Merge pull request #6948Wladimir J. van der Laan
22e7807 Always flush block and undo when switching to new file (Pieter Wuille)
2015-11-05Merge pull request #6934Wladimir J. van der Laan
d1c3762 Revert "Revert "Enable policy enforcing GetMedianTimePast as the end point of lock-time constraints"" (Gregory Maxwell) e4e5334 Restore MedianTimePast for locktime. (Gregory Maxwell)
2015-11-05Merge pull request #6887Wladimir J. van der Laan
53238ff Clarify what minrelaytxfee does (MarcoFalke) abd8b76 [qt] Properly display required fee instead of minTxFee (MarcoFalke)
2015-11-05Always flush block and undo when switching to new filePieter Wuille
Previously, the undo weren't being flushed during a reindex because fKnown was set to true in FindBlockPos. That is the correct behaviour for block files as they aren't being touched, but undo files are touched. This changes the behaviour to always flush when switching to a new file (even for block files, though that isn't really necessary).
2015-11-03Restore MedianTimePast for locktime.Gregory Maxwell
Revert "Revert "Add rules--presently disabled--for using GetMedianTimePast as endpoint for lock-time calculations"" This reverts commit 40cd32e835092c3158175511da5193193ec54939. After careful analysis it was determined that the change was, in fact, safe and several people were suffering momentary confusion about locktime semantics.
2015-11-03Clarify what minrelaytxfee doesMarcoFalke
2015-11-02ModifyNewCoins saves database lookupsAlex Morcos
When processing a new transaction, in addition to spending the Coins of its txin's it creates a new Coins for its outputs. The existing ModifyCoins function will first make sure this Coins does not already exist. It can not exist due to BIP 30, but because of that the lookup can't be cached and always has to go to the database. Since we are creating the coins to match the new tx anyway, there is no point in checking if they exist first anyway. However this should not be used for coinbase tx's in order to preserve the historical behavior of overwriting the two existing duplicate tx pairs.
2015-11-02Make skipping BIP30 check chain agnosticAlex Morcos
2015-11-02Skip BIP30 check after BIP34 activationAlex Morcos
2015-11-02Don't wipe the sigcache in TestBlockValidityPieter Wuille