aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | Store the total sig op count of a tx.Alex Morcos2015-12-011-1/+1
| | | | | | | | | | | | | | | | Store sum of legacy and P2SH sig op counts. This is calculated in AcceptToMemory pool and storing it saves redoing the expensive calculation in block template creation.
* | | | Merge pull request #7141Wladimir J. van der Laan2015-12-011-8/+15
|\ \ \ \ | | | | | | | | | | | | | | | aabc897 rpc: Don't translate warning messages (Wladimir J. van der Laan)
| * | | | rpc: Don't translate warning messagesWladimir J. van der Laan2015-12-011-8/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | But keep translating them in the GUI. This - necessarily - requires duplication of a few messages. Alternative take on #7134, that keeps the translations from being wiped. Also document GetWarnings() input argument. Fixes #5895.
* | | | | Merge pull request #6915Wladimir J. van der Laan2015-12-011-41/+52
|\ \ \ \ \ | |/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2d8860e Fix removeForReorg to use MedianTimePast (Suhas Daftuar) b7fa4aa Don't call removeForReorg if DisconnectTip fails (Suhas Daftuar) 7e49f5f Track coinbase spends in CTxMemPoolEntry (Suhas Daftuar) bb8ea1f removeForReorg calls once-per-disconnect-> once-per-reorg (Matt Corallo) 474b84a Make indentation in ActivateBestChainStep readable (Matt Corallo) b0a064c Fix comment in removeForReorg (Matt Corallo) 9b060e5 Fix removal of time-locked transactions during reorg (Matt Corallo) 0c9959a Add failing test checking timelocked-txn removal during reorg (Matt Corallo)
| * | | | Fix removeForReorg to use MedianTimePastSuhas Daftuar2015-11-301-3/+3
| | | | |
| * | | | Don't call removeForReorg if DisconnectTip failsSuhas Daftuar2015-11-301-7/+1
| | | | |
| * | | | Track coinbase spends in CTxMemPoolEntrySuhas Daftuar2015-11-301-1/+12
| | | | | | | | | | | | | | | | | | | | This allows us to optimize CTxMemPool::removeForReorg.
| * | | | removeForReorg calls once-per-disconnect-> once-per-reorgMatt Corallo2015-11-301-8/+14
| | | | |
| * | | | Make indentation in ActivateBestChainStep readableMatt Corallo2015-11-301-33/+33
| | | | |
| * | | | Fix removal of time-locked transactions during reorgMatt Corallo2015-11-301-1/+1
| | | | |
* | | | | Merge pull request #7079Wladimir J. van der Laan2015-12-011-0/+4
|\ \ \ \ \ | |/ / / / |/| | | | | | | | | | | | | | ebb25f4 Limit setAskFor and retire requested entries only when a getdata returns. (Gregory Maxwell) 5029698 prevent peer flooding request queue for an inv (kazcw)
| * | | | Limit setAskFor and retire requested entries only when a getdata returns.Gregory Maxwell2015-11-231-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The setAskFor duplicate elimination was too eager and removed entries when we still had no getdata response, allowing the peer to keep INVing and not responding.
| * | | | prevent peer flooding request queue for an invkazcw2015-11-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mapAlreadyAskedFor does not keep track of which peer has a request queued for a particular tx. As a result, a peer can blind a node to a tx indefinitely by sending many invs for the same tx, and then never replying to getdatas for it. Each inv received will be placed 2 minutes farther back in mapAlreadyAskedFor, so a short message containing 10 invs would render that tx unavailable for 20 minutes. This is fixed by disallowing a peer from having more than one entry for a particular inv in mapAlreadyAskedFor at a time.
* | | | | Change GetPriority calculation.Alex Morcos2015-11-191-3/+4
| | | | | | | | | | | | | | | | | | | | Compute the value of inputs that already are in the chain at time of mempool entry and only increase priority due to aging for those inputs. This effectively changes the CTxMemPoolEntry's GetPriority calculation from an upper bound to a lower bound.
* | | | | Merge pull request #7112Wladimir J. van der Laan2015-11-301-27/+31
|\ \ \ \ \ | |_|/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 9af5f9c Move uiInterface.NotifyBlockTip signal above the core/wallet signal - This will keep getbestblockhash more in sync with blocknotify callbacks (Jonas Schnelli) 4082e46 [Qt] call GuessVerificationProgress synchronous during core signal, pass double over UI signal (Jonas Schnelli) 947d20b [Qt] reduce cs_main in getVerificationProgress() (Jonas Schnelli) e6d50fc [Qt] update block tip (height and date) without locking cs_main, update always (each block) (Jonas Schnelli) 012fc91 NotifyBlockTip signal: switch from hash (uint256) to CBlockIndex* - also adds a boolean for indication if the tip update was happening during initial sync - emit notification also during initial sync (Jonas Schnelli)
| * | | | Move uiInterface.NotifyBlockTip signal above the core/wallet signalJonas Schnelli2015-11-301-28/+31
| | | | | | | | | | | | | | | | | | | | - This will keep getbestblockhash more in sync with blocknotify callbacks
| * | | | [Qt] call GuessVerificationProgress synchronous during core signal, pass ↵Jonas Schnelli2015-11-301-3/+2
| | | | | | | | | | | | | | | | | | | | double over UI signal
| * | | | NotifyBlockTip signal: switch from hash (uint256) to CBlockIndex*Jonas Schnelli2015-11-301-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | - also adds a boolean for indication if the tip update was happening during initial sync - emit notification also during initial sync
* | | | | Merge pull request #7116Wladimir J. van der Laan2015-11-301-1/+1
|\ \ \ \ \ | |/ / / / |/| | | | | | | | | cb491e7 Trivial: Fix warning introduced by #7053 by casting to uint64_t (Jorge Timón)
| * | | | Trivial: Fix warning introduced by #7053 by casting to uint64_tJorge Timón2015-11-291-1/+1
| | |/ / | |/| |
* | | | Allow block announcements with headersSuhas Daftuar2015-11-291-10/+213
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This replaces using inv messages to announce new blocks, when a peer requests (via the new "sendheaders" message) that blocks be announced with headers instead of inv's. Since headers-first was introduced, peers send getheaders messages in response to an inv, which requires generating a block locator that is large compared to the size of the header being requested, and requires an extra round-trip before a reorg can be relayed. Save time by tracking headers that a peer is likely to know about, and send a headers chain that would connect to a peer's known headers, unless the chain would be too big, in which case we revert to sending an inv instead. Based off of @sipa's commit to announce all blocks in a reorg via inv, which has been squashed into this commit. Rebased-by: Pieter Wuille
* | | | Merge pull request #7106Gregory Maxwell2015-11-281-11/+14
|\ \ \ \ | | | | | | | | | | | | | | | a9f3d3d Fix and improve relay from whitelisted peers (Pieter Wuille)
| * | | | Fix and improve relay from whitelisted peersPieter Wuille2015-11-261-11/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | Merge pull request #6508Pieter Wuille2015-11-281-1/+2
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | 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)
| * | | | | Switch blocks to a constant-space Merkle root/branch algorithm.Pieter Wuille2015-11-271-1/+2
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | [trivial] Reuse translation and cleanup DEFAULT_* valuesMarcoFalke2015-11-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | * DEFAULT_DISABLE_SAFEMODE = false * Use DEFAULT_* constants for extern bools
* | | | | Constrain constant values to a single location in codeLuke Dashjr2015-11-281-5/+5
|/ / / /
* | | | Merge pull request #7053Wladimir J. van der Laan2015-11-271-30/+26
|\ \ \ \ | | | | | | | | | | | | | | | 2e29e7e Globals: Remove a bunch of Params() calls from main.cpp: (Jorge Timón)
| * | | | Globals: Remove a bunch of Params() calls from main.cpp:Jorge Timón2015-11-231-30/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | | Merge pull request #6871Wladimir J. van der Laan2015-11-271-5/+197
|\ \ \ \ \ | |_|/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
| * | | | Fix incorrect locking of mempool during RBF replacementPeter Todd2015-11-101-2/+5
| | | | | | | | | | | | | | | | | | | | Previously RemoveStaged() was called without pool.cs held.
| * | | | Improve RBF replacement criteriaSuhas Daftuar2015-11-101-12/+47
| | | | | | | | | | | | | | | | | | | | Fix the calculation of conflicting size/conflicting fees.
| * | | | Reject replacements that add new unconfirmed inputsPeter Todd2015-11-101-0/+24
| | | | |
| * | | | Prevent low feerate txs from (directly) replacing high feerate txsPeter Todd2015-11-101-24/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | | Add opt-in full-RBF to mempoolPeter Todd2015-11-101-5/+121
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
* | | | | Add enforcenodebloom option.Patick Strateman2015-11-241-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | Move bloom filter filtering logic outside of command "switch" (giant if/else).Patick Strateman2015-11-241-15/+15
| |_|/ / |/| | | | | | | | | | | | | | | Moving this logic outside of the "switch" makes it far simpler to enable the forced disconnect by a parameter.
* | | | Merge pull request #7046Gregory Maxwell2015-11-221-3/+21
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 80ae230 Improve log messages for blocks only violations. (Patick Strateman) 08843ed Add relaytxes status to getpeerinfo (Peter Todd) d8aaa51 Bail early in processing transactions in blocks only mode. (Patick Strateman) 3587f6a Fix relay mechanism for whitelisted peers under blocks only mode. (Patick Strateman)
| * | | | Improve log messages for blocks only violations.Patick Strateman2015-11-211-2/+2
| | | | |
| * | | | Bail early in processing transactions in blocks only mode.Patick Strateman2015-11-201-0/+8
| | | | | | | | | | | | | | | | | | | | Previously unsolicited transactions would be processed as normal.
| * | | | Fix relay mechanism for whitelisted peers under blocks only mode.Patick Strateman2015-11-201-3/+13
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | Previously in blocks only mode all inv messages where type!=MSG_BLOCK would be rejected without regard for whitelisting or whitelistalwaysrelay. As such whitelisted peers would never send the transaction (which would be processed).
* | | | Merge pull request #7011Gregory Maxwell2015-11-211-4/+5
|\ \ \ \ | |/ / / |/| | | | | | | | | | | | | | | | | | | 6531f17 Add mediantime field to getblock and getblockheader (Peter Todd) 7259769 Document new mediantime field in getblockchaininfo (Peter Todd) c277a63 Clarify nLockTime-by-time comment in CheckFinalTx() (Peter Todd) 748321e Add mediantime field to getblockchaininfo RPC call (Peter Todd)
| * | | Clarify nLockTime-by-time comment in CheckFinalTx()Peter Todd2015-11-131-4/+5
| | | |
* | | | Merge pull request #6932Wladimir J. van der Laan2015-11-181-3/+10
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | 1cf3dd8 Add unit test for UpdateCoins (Alex Morcos) 03c8282 Make CCoinsViewTest behave like CCoinsViewDB (Alex Morcos) 14470f9 ModifyNewCoins saves database lookups (Alex Morcos)
| * | | | ModifyNewCoins saves database lookupsAlex Morcos2015-11-021-3/+10
| | | | | | | | | | | | | | | | | | | | 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.
* | | | | Fix debug log message for block filesAlex Morcos2015-11-171-1/+1
| |_|_|/ |/| | |
* | | | Merge pull request #6986Gregory Maxwell2015-11-161-7/+5
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | 6bc9e40 Chainparams: Explicit CChainParams arg for miner: (Jorge Timón) 598e494 Chainparams: Explicit CChainParams arg for main (pre miner): (Jorge Timón)
| * | | | Chainparams: Explicit CChainParams arg for main (pre miner):Jorge Timón2015-11-111-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | -ProcessNewBlock -TestBlockValidity
* | | | | Fixed integer comparison warning.Eric Lombrozo2015-11-151-1/+1
| | | | |
* | | | | Merge pull request #6993Gregory Maxwell2015-11-141-2/+2
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)