aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
Commit message (Collapse)AuthorAgeFilesLines
* include the chaintip *blockIndex in the SyncTransaction signalJonas Schnelli2015-12-041-4/+4
| | | | | - allows reducing of calls to main.cpp for getting the chaintip during transaction syncing - potentially allows reducing of cs_main locks
* Merge pull request #7113Wladimir J. van der Laan2015-12-031-1/+1
|\ | | | | | | 086ee67 Switch to a more efficient rolling Bloom filter (Pieter Wuille)
| * Switch to a more efficient rolling Bloom filterPieter Wuille2015-11-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For each 'bit' in the filter we really maintain 2 bits, which store either: 0: not set 1-3: set in generation N After (nElements / 2) insertions, we switch to a new generation, and wipe entries which already had the new generation number, effectively switching from the last 1.5 * nElements set to the last 1.0 * nElements set. This is 25% more space efficient than the previous implementation, and can (at peak) store 1.5 times the requested amount of history (though only 1.0 times the requested history is guaranteed). The existing unit tests should be sufficient.
* | Merge pull request #7133Wladimir J. van der Laan2015-12-031-11/+8
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | aa4b0c2 When not filtering blocks, getdata sends more in one test (Pieter Wuille) d41e44c Actually only use filterInventoryKnown with MSG_TX inventory messages. (Gregory Maxwell) b6a0da4 Only use filterInventoryKnown with MSG_TX inventory messages. (Patick Strateman) 6b84935 Rename setInventoryKnown filterInventoryKnown (Patick Strateman) e206724 Remove mruset as it is no longer used. (Gregory Maxwell) ec73ef3 Replace setInventoryKnown with a rolling bloom filter. (Gregory Maxwell)
| * | Actually only use filterInventoryKnown with MSG_TX inventory messages.Gregory Maxwell2015-11-301-9/+7
| | | | | | | | | | | | Previously this logic could erroneously filter a MSG_BLOCK inventory message.
| * | Rename setInventoryKnown filterInventoryKnownPatick Strateman2015-11-301-3/+3
| | |
| * | Replace setInventoryKnown with a rolling bloom filter.Gregory Maxwell2015-11-301-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mruset setInventoryKnown was reduced to a remarkably small 1000 entries as a side effect of sendbuffer size reductions in 2012. This removes setInventoryKnown filtering from merkleBlock responses because false positives there are especially unattractive and also because I'm not sure if there aren't race conditions around the relay pool that would cause some transactions there to be suppressed. (Also, ProcessGetData was accessing setInventoryKnown without taking the required lock.)
* | | PartitionCheck: remove useless spacespaveljanik2015-12-021-3/+3
| | |
* | | Fix various typospaveljanik2015-12-021-3/+3
| | |
* | | Flush coins cache also after transaction processingPieter Wuille2015-12-011-0/+1
| | |
* | | Uncache input txn in utxo cache if a tx is not accepted to mempoolMatt Corallo2015-12-011-3/+22
| | |
* | | Discard txn cache entries that were loaded for removed mempool txnMatt Corallo2015-12-011-8/+15
| | |
* | | Expose FormatStateMessageAlex Morcos2015-12-011-1/+1
| | |
* | | 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.