aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
AgeCommit message (Collapse)Author
2015-12-02Fix various typospaveljanik
2015-12-01Flush coins cache also after transaction processingPieter Wuille
2015-12-01Uncache input txn in utxo cache if a tx is not accepted to mempoolMatt Corallo
2015-12-01Discard txn cache entries that were loaded for removed mempool txnMatt Corallo
2015-12-01Expose FormatStateMessageAlex Morcos
2015-12-01Store the total sig op count of a tx.Alex Morcos
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.
2015-12-01Merge pull request #7141Wladimir J. van der Laan
aabc897 rpc: Don't translate warning messages (Wladimir J. van der Laan)
2015-12-01Merge pull request #6915Wladimir J. van der Laan
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)
2015-12-01rpc: Don't translate warning messagesWladimir J. van der Laan
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.
2015-12-01Merge pull request #7079Wladimir J. van der Laan
ebb25f4 Limit setAskFor and retire requested entries only when a getdata returns. (Gregory Maxwell) 5029698 prevent peer flooding request queue for an inv (kazcw)
2015-11-30Fix removeForReorg to use MedianTimePastSuhas Daftuar
2015-11-30Don't call removeForReorg if DisconnectTip failsSuhas Daftuar
2015-11-30Track coinbase spends in CTxMemPoolEntrySuhas Daftuar
This allows us to optimize CTxMemPool::removeForReorg.
2015-11-30removeForReorg calls once-per-disconnect-> once-per-reorgMatt Corallo
2015-11-30Make indentation in ActivateBestChainStep readableMatt Corallo
2015-11-30Fix removal of time-locked transactions during reorgMatt Corallo
2015-11-23Limit setAskFor and retire requested entries only when a getdata returns.Gregory Maxwell
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.
2015-11-23prevent peer flooding request queue for an invkazcw
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.
2015-11-22Merge pull request #7046Gregory Maxwell
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)
2015-11-21Improve log messages for blocks only violations.Patick Strateman
2015-11-21Merge pull request #7011Gregory Maxwell
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)
2015-11-20Bail early in processing transactions in blocks only mode.Patick Strateman
Previously unsolicited transactions would be processed as normal.
2015-11-20Fix relay mechanism for whitelisted peers under blocks only mode.Patick Strateman
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).
2015-11-19Change GetPriority calculation.Alex Morcos
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.
2015-11-30Merge pull request #7112Wladimir J. van der Laan
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)
2015-11-30Move uiInterface.NotifyBlockTip signal above the core/wallet signalJonas Schnelli
- This will keep getbestblockhash more in sync with blocknotify callbacks
2015-11-30Merge pull request #7116Wladimir J. van der Laan
cb491e7 Trivial: Fix warning introduced by #7053 by casting to uint64_t (Jorge Timón)
2015-11-30[Qt] call GuessVerificationProgress synchronous during core signal, pass ↵Jonas Schnelli
double over UI signal
2015-11-30NotifyBlockTip signal: switch from hash (uint256) to CBlockIndex*Jonas Schnelli
- also adds a boolean for indication if the tip update was happening during initial sync - emit notification also during initial sync
2015-11-29Trivial: Fix warning introduced by #7053 by casting to uint64_tJorge Timón
2015-11-29Allow block announcements with headersSuhas Daftuar
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
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