aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
AgeCommit message (Collapse)Author
2016-11-23Send tip change notification from invalidateblockRussell Yanofsky
This change is needed to prevent sync_blocks timeouts in the mempool_reorg test after the sync_blocks update in the upcoming commit "[qa] Change sync_blocks to pick smarter maxheight". This change was initially suggested by Suhas Daftuar <sdaftuar@chaincode.com> in https://github.com/bitcoin/bitcoin/pull/8680#r78209060 Github-Pull: #9196 Rebased-From: 67c6326abd1788e6f411feb4f44b69774e76aae2
2016-09-01Merge #8176: [0.12.x]: Versionbits: GBT supportWladimir J. van der Laan
db4bacf getblocktemplate: Use version/force mutation to support pre-BIP9 clients (Luke Dashjr) 65ee332 getblocktemplate: Explicitly handle the distinction between GBT-affecting softforks vs not (Luke Dashjr) 40e81f5 qa/rpc-tests: bip9-softforks: Add tests for getblocktemplate versionbits updates (Luke Dashjr) ddd8c01 Implement BIP 9 GBT changes (Luke Dashjr)
2016-06-08Implement BIP 9 GBT changesLuke Dashjr
- BIP9DeploymentInfo struct for static deployment info - VersionBitsDeploymentInfo: Avoid C++11ism by commenting parameter names - getblocktemplate: Make sure to set deployments in the version if it is LOCKED_IN - In this commit, all rules are considered required for clients to support
2016-04-27Fix headers announcements edge caseSuhas Daftuar
Previously we would assert that if every block in vBlockHashesToAnnounce is in chainActive, then the blocks to be announced must connect. However, there are edge cases where this assumption could be violated (eg using invalidateblock / reconsiderblock), so just check for this case and revert to inv-announcement instead. Github-Pull: #7919 Rebased-From: 3a99fb2cb14955f5e029d315041a093e957e6c3e
2016-04-27Use txid as key in mapAlreadyAskedForSuhas Daftuar
Previously we used the CInv that would be sent to the peer announcing the transaction as the key, but using the txid instead allows us to decouple the p2p layer from the application logic (which relies on this map to avoid duplicate tx requests). Github-Pull: #7862 Rebased-From: 7e91f632c70ff1848a152f24ee67a06796803943
2016-04-27Avoid "Unknown command" messages when receiving getaddr on outbound connections.R E Broadley
Github-Pull: #7642 Rebased-From: d84ea1a59ce3704457a162f1fd8a7353047156de
2016-04-27fix spelling of advertise in src and docjloughry
Github-Pull: #7526 Rebased-From: 37767fd46f673a06864df6e14d3030622b1cb2c9
2016-04-27Do not download transactions during inital syncptschip
Github-Pull: #7164 Rebased-From: 39a525c21fd1b34df63ab30868423b97b708ee49
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