aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
AgeCommit message (Collapse)Author
2015-10-23Merge pull request #6856Wladimir J. van der Laan
d3b09f6 Do not allow blockfile pruning during reindex. (Alex Morcos)
2015-10-23Merge pull request #6351Wladimir J. van der Laan
65ef372 Add BIP65 to getblockchaininfo softforks list (Peter Todd) cde7ab2 Add RPC tests for the CHECKLOCKTIMEVERIFY (BIP65) soft-fork (Peter Todd) 287f54f Add CHECKLOCKTIMEVERIFY (BIP65) soft-fork logic (Peter Todd)
2015-10-21Merge pull request #6722Wladimir J. van der Laan
58254aa Fix stale comment in CTxMemPool::TrimToSize. (Matt Corallo) 2bc5018 Fix comment formatting tabs (Matt Corallo) 8abe0f5 Undo GetMinFee-requires-extra-call-to-hit-0 (Matt Corallo) 9e93640 Drop minRelayTxFee to 1000 (Matt Corallo) 074cb15 Add reasonable test case for mempool trimming (Matt Corallo) d355cf4 Only call TrimToSize once per reorg/blocks disconnect (Matt Corallo) 794a8ce Implement on-the-fly mempool size limitation. (Matt Corallo) e6c7b36 Print mempool size in KB when adding txn (Matt Corallo) 241d607 Add CFeeRate += operator (Matt Corallo) e8bcdce Track (and define) ::minRelayTxFee in CTxMemPool (Matt Corallo) 9c9b66f Fix calling mempool directly, instead of pool, in ATMP (Matt Corallo) 49b6fd5 Add Mempool Expire function to remove old transactions (Pieter Wuille) 78b82f4 Reverse the sort on the mempool's feerate index (Suhas Daftuar)
2015-10-19Do not allow blockfile pruning during reindex.Alex Morcos
Also clarify startup message.
2015-10-14doc: add comment explaining initial header requestDaniel Kraft
Add a comment that explains why the initial "getheader" requests are made starting from the block preceding the currently best one. Thanks to sdaftuar for the explanation!
2015-10-13Drop minRelayTxFee to 1000Matt Corallo
There is no exact science to setting this parameter, but 5000 (just over 1 US cent at the time of writing) is higher than the cost to relay a transaction around the network (the new benchmark due to mempool limiting).
2015-10-13Only call TrimToSize once per reorg/blocks disconnectMatt Corallo
2015-10-13Implement on-the-fly mempool size limitation.Matt Corallo
After each transaction which is added to mempool, we first call Expire() to remove old transactions, then throwing away the lowest-feerate transactions. After throwing away transactions by feerate, we set the minimum relay fee to the maximum fee transaction-and-dependant-set we removed, plus the default minimum relay fee. After the next block is received, the minimum relay fee is allowed to decrease exponentially. Its halflife defaults to 12 hours, but is decreased to 6 hours if the mempool is smaller than half its maximum size, and 3 hours if the mempool is smaller than a quarter its maximum size. The minimum -maxmempool size is 40*-limitdescendantsize, as it is easy for an attacker to play games with the cheapest -limitdescendantsize transactions. -maxmempool defaults to 300MB. This disables high-priority transaction relay when the min relay fee adjustment is >0 (ie when the mempool is full). When the relay fee adjustment drops below the default minimum relay fee / 2 it is set to 0 (re-enabling priority-based free relay).
2015-10-13Print mempool size in KB when adding txnMatt Corallo
2015-10-13Fix calling mempool directly, instead of pool, in ATMPMatt Corallo
2015-10-09Bump minrelaytxfee defaultWladimir J. van der Laan
To bridge the time until a dynamic method for determining this fee is merged. This is especially aimed at the stable releases (0.10, 0.11) because full mempool limiting, as will be in 0.12, is too invasive and risky to backport.
2015-10-08Add CHECKLOCKTIMEVERIFY (BIP65) soft-fork logicPeter Todd
Based on the earlier BIP66 soft-fork logic implemented by Pieter Wuille's 5a47811da5158df763aa2fca09ce646ee0c51e7b
2015-10-01Merge pull request #5987Wladimir J. van der Laan
e761d7a Bugfix: Allow mining on top of old tip blocks for testnet (fixes testnet-in-a-box use case) (Luke Dashjr)
2015-10-01Merge pull request #6588Jeff Garzik
2015-09-30Merge pull request #6680Wladimir J. van der Laan
d76a8ac use CBlockIndex* insted of uint256 for UpdatedBlockTip signal (Jonas Schnelli)
2015-09-29Bugfix: Allow mining on top of old tip blocks for testnet (fixes ↵Luke Dashjr
testnet-in-a-box use case)
2015-09-23Merge pull request #6550Wladimir J. van der Laan
3b33ec8 Avoid duplicate CheckBlock checks (Pieter Wuille) 391dff1 Do not store Merkle branches in the wallet. (Pieter Wuille)
2015-09-23Merge pull request #6688Wladimir J. van der Laan
131c23d Fix locking in GetTransaction. (Alex Morcos)
2015-09-23Merge pull request #6148Wladimir J. van der Laan
ae6f957 Enable block relay when pruning (Suhas Daftuar) 0da6ae2 Do not inv old or missing blocks when pruning (Suhas Daftuar)
2015-09-23Merge pull request #6646Wladimir J. van der Laan
6ecaec3 [Trivial] [logging] Rm extraneous cleansubver in serveral debug messages. (Gregory Maxwell)
2015-09-22Avoid duplicate CheckBlock checksPieter Wuille
2015-09-22Do not store Merkle branches in the wallet.Pieter Wuille
Assume that when a wallet transaction has a valid block hash and transaction position in it, the transaction is actually there. We're already trusting wallet data in a much more fundamental way anyway. To prevent backward compatibility issues, a new record is used for storing the block locator in the wallet. Old wallets will see a wallet file synchronized up to the genesis block, and rescan automatically.
2015-09-19Track transaction packages in CTxMemPoolEntrySuhas Daftuar
Associate with each CTxMemPoolEntry all the size/fees of descendant mempool transactions. Sort mempool by max(feerate of entry, feerate of descendants). Update statistics on-the-fly as transactions enter or leave the mempool. Also add ancestor and descendant limiting, so that transactions can be rejected if the number or size of unconfirmed ancestors exceeds a target, or if adding a transaction would cause some other mempool entry to have too many (or too large) a set of unconfirmed in- mempool descendants.
2015-09-17Fix locking in GetTransaction.Alex Morcos
GetTransaction needs to lock cs_main until ReadBlockFromDisk completes, the data inside CBlockIndex's can change since pruning. This lock was held by all calls to GetTransaction except rest_tx.
2015-09-16use CBlockIndex* insted of uint256 for UpdatedBlockTip signalJonas Schnelli
- removes mapBlockIndex find operation - theoretically allows removing the cs_main lock during zqm notification while introducing a new file position lock
2015-09-16Add UpdatedBlockTip signal to CMainSignals and CValidationInterfaceJoão Barbosa
2015-09-08[Trivial] [logging] Rm extraneous cleansubver in serveral debug messages.Gregory Maxwell
We log the cleanSubVer as part of connect. It is not uniquely more informative than any of the other data we have about a peer, often less. It's also often long now as well. There is no need to output it as part of mempoolrej, AcceptToMemoryPool, or pong entries. Leaving it out makes our log entries more uniform and consistent.
2015-09-05Add NODE_BLOOM service bit and bump protocol versionMatt Corallo
Lets nodes advertise that they offer bloom filter support explicitly. The protocol version bump allows SPV nodes to assume that NODE_BLOOM is set if NODE_NETWORK is set for pre-70011 nodes. Also adds an option to turn bloom filter support off for nodes which advertise a version number >= 70011. Nodes attempting to use bloom filters on such protocol versions are banned, and a later upgade should drop nodes of an older version which attempt to use bloom filters. Much code stolen from Peter Todd. Implements BIP 111
2015-09-03In (strCommand == "tx"), return if AlreadyHave()Tom Harding
The main effect is to exit processing for recently-rejected hashes, in case they are pushed to us without prior advertisement. This behavior was seen in the wild. An additional effect is to do early checks for mempool or mapOrphan existence. No logging or nDoS tracking is needed for failures of these checks.
2015-08-22Record nMinPingUsecTimePatrick Strateman
2015-08-19Merge pull request #6539Wladimir J. van der Laan
9f68ed6 typofixes (found by misspell_fixer) (Veres Lajos)
2015-08-11Merge pull request #6519Wladimir J. van der Laan
7f1f8f5 Move mempool rejections to new debug category (Wladimir J. van der Laan) 66daed5 Add information to errors in ConnectBlock, CheckBlock (Wladimir J. van der Laan) 6cab808 Remove most logging from transaction validation (Wladimir J. van der Laan) 9003c7c Add function to convert CValidationState to a human-readable message (Wladimir J. van der Laan) dc58258 Introduce REJECT_INTERNAL codes for local AcceptToMempool errors (Wladimir J. van der Laan) fbf44e6 Add debug message to CValidationState for optional extra information (Wladimir J. van der Laan)
2015-08-11Move mempool rejections to new debug categoryWladimir J. van der Laan
Move mempool rejections to debug category `mempoolrej`, to make it possible to show them without enabling the entire category `mempool` which is high volume.
2015-08-11Add information to errors in ConnectBlock, CheckBlockWladimir J. van der Laan
Add detailed state information to the errors, as it is no longer being logged downstream. Also add the state information to mempool rejection debug message in ProcessMessages.
2015-08-11Remove most logging from transaction validationWladimir J. van der Laan
Remove unnecessary direct logging in CheckTransaction, AcceptToMemoryPool, CheckTxInputs, CScriptCheck::operator() All status information should be returned in the CValidationState. Relevant debug information is also added to the CValidationState using the recently introduced debug message. Do keep the "BUG! PLEASE REPORT THIS! ConnectInputs failed against MANDATORY but not STANDARD flags" error as it is meant to appear as bug in the log.
2015-08-11Add function to convert CValidationState to a human-readable messageWladimir J. van der Laan
It is necessary to be able to concisely log a validation state. Convert CValidationState to a human-readable message for logging.
2015-08-11Introduce REJECT_INTERNAL codes for local AcceptToMempool errorsWladimir J. van der Laan
Add status codes specific to AcceptToMempool procession of transactions. These can never happen due to block validation, and must never be sent over the P2P network. Add assertions where appropriate.
2015-08-10typofixes (found by misspell_fixer)Veres Lajos
2015-08-08Add some const declarations where they are appropriate.Daniel Kraft
Declare some arguments of functions as "const" pointers where they are not meant to be modified.
2015-08-07Merge pull request #6377Wladimir J. van der Laan
c433828 Handle no chain tip available in InvalidChainFound() (Ross Nicoll)
2015-08-05Merge pull request #5913Wladimir J. van der Laan
5922b67 Add assertion and cast before sending reject code (Wladimir J. van der Laan) a651403 Add absurdly high fee message to validation state (for RPC propagation) (Shaul Kfir)
2015-08-05Add assertion and cast before sending reject codeWladimir J. van der Laan
This gets rid of a warning. Add an assertion to make sure that the reject code is in the correct range for the network protocol (if it is outside the range it must be a bug)
2015-08-05Merge pull request #6462Wladimir J. van der Laan
7b79cbd limit total length of user agent comments (Pavol Rusnak) 557f8ea implement uacomment config parameter which can add comments to user agent as per BIP-0014 (Pavol Rusnak)
2015-08-05limit total length of user agent commentsPavol Rusnak
Reworked-By: Wladimir J. van der Laan <laanwj@gmail.com>
2015-08-03Merge pull request #6498Wladimir J. van der Laan
a8d0407 Move recentRejects initialization to top of InitBlockIndex (Wladimir J. van der Laan) 0847d9c Keep track of recently rejected transactions (Peter Todd) d741371 Only use randomly created nonces in CRollingBloomFilter. (Pieter Wuille) d2d7ee0 Make CRollingBloomFilter set nTweak for you (Peter Todd) a3d65fe Reuse vector hashing code for uint256 (Pieter Wuille) bbe4108 Add uint256 support to CRollingBloomFilter (Peter Todd)
2015-08-03Make sure LogPrintf strings are line-terminatedWladimir J. van der Laan
Fix the cases where LogPrint[f] was accidentally called without line terminator, which resulted in concatenated log lines. (see e.g. #6492)
2015-07-31Move recentRejects initialization to top of InitBlockIndexWladimir J. van der Laan
This avoids that premature return in the condition that a new chain is initialized results in NULL pointer errors due to recentReject not being constructed. Also add assertions where it is used.
2015-07-29Merge pull request #6224Wladimir J. van der Laan
59b49cd Eliminate signed/unsigned comparison warning (Suhas Daftuar) 04b5d23 Replace sleep with syncing using pings (Suhas Daftuar) 6b1066f Ignore whitelisting during IBD for unrequested blocks. (Suhas Daftuar) bfc30b3 Ignore unrequested blocks too far ahead of tip (Suhas Daftuar)
2015-07-28Keep track of recently rejected transactionsPeter Todd
Nodes can have divergent policies on which transactions they will accept and relay. This can cause you to repeatedly request and reject the same tx after its inved to you from various peers which have accepted it. Here we add rolling bloom filter to keep track of such rejections, clearing the filter every time the chain tip changes. Credit goes to Alex Morcos, who created the patch that this code is based on. Original code by Peter Todd. Refactored to not construct the filter at startup time by Pieter Wuille.
2015-07-28Revert "Cache transaction validation successes"Pieter Wuille
This reverts commit 17b11428c135203342aff38cabc8047e673f38ac.