aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
AgeCommit message (Collapse)Author
2016-04-08Version 2 transactions remain non-standard until CSV activatesSuhas Daftuar
Before activation, such transactions might not be mined, so don't allow into the mempool. - Tests: move get_bip9_status to util.py - Test relay of version 2 transactions Github-Pull: #7835 Rebased-From: e4ba9f6b0402cf7a2ad0d74f617c434a26c6e124 5cb1d8a2071d05beb9907a423178895fd8a5c359 da5fdbb3a2778523cce70d635c1aa2b31a693bc6
2016-04-07Track block download times per individual blockPieter Wuille
Currently, we're keeping a timeout for each requested block, starting from when it is requested, with a correction factor for the number of blocks in the queue. That's unnecessarily complicated and inaccurate. As peers process block requests in order, we can make the timeout for each block start counting only when all previous ones have been received, and have a correction based on the number of peers, rather than the total number of blocks. Conflicts: src/main.cpp src/main.h Self check after the last peer is removed Github-Pull: #7804 Rebased-From: 2d1d6581eca4508838cd339cc19c72efc42d6ea0 0e24bbf679c95784ed5514a6a1f2fbf99dd97725
2016-04-07init: allow shutdown during 'Activating best chain...'Wladimir J. van der Laan
Two-line patch to make it possible to shut down bitcoind cleanly during the initial ActivateBestChain. Fixes #6459 (among other complaints). To reproduce: - shutdown bitcoind - copy chainstate - start bitcoind - let the chain sync a bit - shutdown bitcoind - copy back old chainstate - start bitcoind - bitcoind will catch up with all blocks during Init() (the `boost::this_thread::interruption_point` / `ShutdownRequested()` dance is ugly, this should be refactored all over bitcoind at some point when moving from boost::threads to c++11 threads, but it works...) Github-Pull: #7821 Rebased-From: 07398e8e9d2ef807e63abd0978a6e98549bdf271
2016-03-18Soft fork logic for BIP68BtcDrak
2016-03-18Soft fork logic for BIP113BtcDrak
2016-03-18Add CHECKSEQUENCEVERIFY softfork through BIP9Pieter Wuille
2016-03-18Softfork status report in RPCPieter Wuille
2016-03-18BIP9 ImplementationPieter Wuille
Inspired by former implementations by Eric Lombrozo and Rusty Russell, and based on code by Jorge Timon.
2016-03-18Add LockPointsAlex Morcos
Obtain LockPoints to store in CTxMemPoolEntry and during a reorg, evaluate whether they are still valid and if not, recalculate them.
2016-03-18fix sdaftuar's nits againAlex Morcos
it boggles the mind why these nits can't be delivered on a more timely basis
2016-03-18Implement SequenceLocks functionsAlex Morcos
SequenceLocks functions are used to evaluate sequence lock times or heights per BIP 68. The majority of this code is copied from maaku in #6312 Further credit: btcdrak, sipa, NicolasDorier
2016-02-10Update the wallet best block marker when pruningPieter Wuille
Github-Pull: #7502 Rebased-From: e4eebb604e19f67b0c7a483b1ded1229d75ecdd3
2016-02-09Update nQueuedValidatedHeaders after peer disconnectionSuhas Daftuar
Github-Pull: #7482 Rebased-From: 301bc7bc7e83f4c268c1722558b07dbb5b55fa92
2016-02-03Merge #7440: [0.12] Rename permitrbf to mempoolreplacement and provide ↵Wladimir J. van der Laan
minimal string-list forward compatibility af9f564 release-notes: Update for replacebyfee->mempoolreplacement rename (Luke Dashjr) 4ad418b Rename replacebyfee=opt-in to mempoolreplacement=fee (Luke Dashjr) b2287a7 release-notes: Update for permitrbf->replacebyfee rename (Luke Dashjr) 5f456a6 Simplify check for replacebyfee=opt-in (Luke Dashjr) e8d19ab Accept replacebyfee=opt-in for turning on opt-in RBF (Luke Dashjr) 1205f87 Rename permitrbf to replacebyfee (Luke Dashjr)
2016-02-01Add whitelistforcerelay to control forced relaying. [#7099 redux]Gregory Maxwell
- Add whitelistforcerelay to control forced relaying. Also renames whitelistalwaysrelay. Nodes relay all transactions from whitelisted peers, this gets in the way of some useful reasons for whitelisting peers-- for example, bypassing bandwidth limitations. The purpose of this forced relaying is for specialized gateway applications where a node is being used as a P2P connection filter and multiplexer, but where you don't want it getting in the way of (re-)broadcast. This change makes it configurable with whitelistforcerelay. - Blacklist -whitelistalwaysrelay; replaced by -whitelistrelay. Github-Pull: #7439 Rebased-From: 325c725fb6205e38142914acb9ed1733d8482d46 89d113e02a83617b4e971c160d47551476dacc71
2016-01-29Rename permitrbf to replacebyfeeLuke Dashjr
"permit" is currently used to configure transaction filtering, whereas replacement is more to do with the memory pool state than the transaction itself.
2016-01-21Add option `-permitrbf` to set transaction replacement policyWladimir J. van der Laan
Add a configuration option `-permitrbf` to set transaction replacement policy for the mempool. Enabling it will enable (opt-in) RBF, disabling it will refuse all conflicting transactions. Conflicts: src/init.cpp src/main.cpp src/main.h Github-Pull: #7386 Rebased-From: b768108d9c0b83330572711aef1e569543130d5e
2016-01-09Merge branch bytespersigopLuke Dashjr
2016-01-05Bump copyright headers to 2015MarcoFalke
- Bump copyright headers to 2015 - [devtools] Rewrite fix-copyright-headers.py - [devtools] Use git pretty-format for year parsing Github-Pull: #7205 Rebased-From: fa6ad855e9159b2247da4fa0054f32fa181499ab fa24439ff3d8ab5b9efaf66ef4dae6713b88cb35 fa71669452e57039e4270fd2b33a0e0e1635b813
2016-01-05Mark blocks with too many sigops as failedSuhas Daftuar
Github-Pull: #7217 Rebased-From: 5246180f168c9b761b6158b0725f5718239ba66c
2016-01-04Report non-mandatory script failures correctlyPieter Wuille
Github-Pull: #7276 Rebased-From: 7ef8f3c072a8750c72a3a1cdc727b5c1d173bac8
2015-12-21[Mempool] Fix mempool limiting and replace-by-fee for PrioritiseTransactionSuhas Daftuar
1) Fix mempool limiting for PrioritiseTransaction Redo the feerate index to be based on mining score, rather than fee. Update mempool_packages.py to test prioritisetransaction's effect on package scores. 2) Update replace-by-fee logic to use fee deltas 3) Use fee deltas for determining mempool acceptance 4) Remove GetMinRelayFee One test in AcceptToMemoryPool was to compare a transaction's fee agains the value returned by GetMinRelayFee. This value was zero for all small transactions. For larger transactions (between DEFAULT_BLOCK_PRIORITY_SIZE and MAX_STANDARD_TX_SIZE), this function was preventing low fee transactions from ever being accepted. With this function removed, we will now allow transactions in that range with fees (including modifications via PrioritiseTransaction) below the minRelayTxFee, provided that they have sufficient priority. Github-Pull: #7062 Rebased-From: eb306664e786ae43d539fde66f0fbe2a3e89d910 9ef2a25603c9ec4e44c4f45c6a5d4e4386ec86d3 27fae3484cdb21b0d24face833b966fce5926be5 901b01d674031f9aca717deeb372bafa160a24af
2015-12-14Replace trickle nodes with per-node/message Poisson delaysPieter Wuille
We used to have a trickle node, a node which was chosen in each iteration of the send loop that was privileged and allowed to send out queued up non-time critical messages. Since the removal of the fixed sleeps in the network code, this resulted in fast and attackable treatment of such broadcasts. This pull request changes the 3 remaining trickle use cases by random delays: * Local address broadcast (while also removing the the wiping of the seen filter) * Address relay * Inv relay (for transactions; blocks are always relayed immediately) The code is based on older commits by Patrick Strateman. Github-Pull: #7125 Rebased-From: 5400ef6bcb9d243b2b21697775aa6491115420f3
2015-12-11net: Add and document network messages in protocol.hWladimir J. van der Laan
- Avoids string typos (by making the compiler check) - Makes it easier to grep for handling/generation of a certain message type - Refer directly to documentation by following the symbol in IDE - Move list of valid message types to protocol.cpp: protocol.cpp is a more appropriate place for this, and having the array there makes it easier to keep things consistent. Github-Pull: #7181 Rebased-From: 9bbe71b641e2fc985daf127988a14a67c99da50a
2015-12-10net: Fix sent reject messages for blocks and transactionsWladimir J. van der Laan
Ever since we #5913 have been sending invalid reject messages for transactions and blocks. test: Add basic test for `reject` code Extend P2P test framework to make it possible to expect reject codes for transactions and blocks. Github-Pull: #7179 Rebased-From: 9fc6ed6003da42f035309240c715ce0fd063ec03 20411903d7b356ebb174df2daad1dcd5d6117f79
2015-12-07Don't do mempool lookups for "mempool" command without a filterMatt Corallo
Github-Pull: #7174 Rebased-From: 96918a2f0990a8207d7631b8de73af8ae5d24aeb
2015-12-04Replace setInventoryKnown with a rolling bloom filter.Gregory Maxwell
Github-Pull: #7133 Rebased-From: ec73ef37eccfeda76de55c4ff93ea54d4e69e1ec e20672479ef7f2048c2e27494397641d47a4d88d 6b849350ab074a7ccb80ecbef387f59e1271ded6 b6a0da45db8d534e7a77d1cebe382cd5d83ba9b8 d41e44c9accb3df84e0abbc602cc76b72754d382 aa4b0c26b0a94ca6164c441aae723e118554d214
2015-12-04Disconnect on mempool requests from peers when over the upload limit.Gregory Maxwell
Mempool requests use a fair amount of bandwidth when the mempool is large, disconnecting peers using them follows the same logic as disconnecting peers fetching historical blocks. Rebased-From: 6aadc7557823b7673b8f661b3d41cf867e2936a3 Github-Pull: #7166
2015-12-02PartitionCheck: remove useless spacespaveljanik
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-01-bytespersigop option to additionally limit sigops in transactions we relay ↵Luke Dashjr
and mine
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