aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge #9058: Fixes for p2p-compactblocks.py test timeouts on travis (#8842)Wladimir J. van der Laan2016-11-111-0/+12
|\ | | | | | | | | | | dac53b5 Modify getblocktxn handler not to drop requests for old blocks (Russell Yanofsky) 55bfddc [qa] Fix stale data bug in test_compactblocks_not_at_tip (Russell Yanofsky) 47e9659 [qa] Fix bug in compactblocks v2 merge (Russell Yanofsky)
| * Modify getblocktxn handler not to drop requests for old blocksRussell Yanofsky2016-11-071-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current getblocktxn implementation drops and ignores requests for old blocks, which causes occasional sync_block timeouts during the p2p-compactblocks.py test as reported in https://github.com/bitcoin/bitcoin/issues/8842. The p2p-compactblocks.py test setup creates many new blocks in a short period of time, which can lead to getblocktxn requests for blocks below the hardcoded depth limit of 10 blocks. This commit changes the getblocktxn handler not to ignore these requests, so the peer nodes in the test setup will reliably be able to sync. The protocol change is documented in BIP-152 update "Allow block responses to getblocktxn requests" at https://github.com/bitcoin/bips/pull/469. The protocol change is not expected to affect nodes running outside the test environment, because there shouldn't normally be lots of new blocks being rapidly added that need to be synced.
* | Merge #9049: Remove duplicatable duplicate-input check from CheckTransactionWladimir J. van der Laan2016-11-101-9/+10
|\ \ | | | | | | | | | | | | | | | e2b3fb3 Optimize vInOutPoints insertion a bit (Matt Corallo) eecffe5 Remove redundant duplicate-input check from CheckTransaction (Matt Corallo) b2e178a Add deserialize + CheckBlock benchmarks, and a full block hex (Matt Corallo)
| * | Optimize vInOutPoints insertion a bitMatt Corallo2016-11-091-2/+1
| | |
| * | Remove redundant duplicate-input check from CheckTransactionMatt Corallo2016-11-091-9/+11
| | |
* | | Merge #9039: Various serialization simplifcations and optimizationsWladimir J. van der Laan2016-11-091-2/+2
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | d59a518 Use fixed preallocation instead of costly GetSerializeSize (Pieter Wuille) 25a211a Add optimized CSizeComputer serializers (Pieter Wuille) a2929a2 Make CSerAction's ForRead() constexpr (Pieter Wuille) a603925 Avoid -Wshadow errors (Pieter Wuille) 5284721 Get rid of nType and nVersion (Pieter Wuille) 657e05a Make GetSerializeSize a wrapper on top of CSizeComputer (Pieter Wuille) fad9b66 Make nType and nVersion private and sometimes const (Pieter Wuille) c2c5d42 Make streams' read and write return void (Pieter Wuille) 50e8a9c Remove unused ReadVersion and WriteVersion (Pieter Wuille)
| * | Make GetSerializeSize a wrapper on top of CSizeComputerPieter Wuille2016-11-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Given that in default GetSerializeSize implementations created by ADD_SERIALIZE_METHODS we're already using CSizeComputer(), get rid of the specialized GetSerializeSize methods everywhere, and just use CSizeComputer. This removes a lot of code which isn't actually used anywhere. For CCompactSize and CVarInt this actually removes a more efficient size computing algorithm, which is brought back in a later commit.
* | | Merge #9026: Fix handling of invalid compact blocksPieter Wuille2016-11-071-14/+32
|\ \ \ | | | | | | | | | | | | | | | | | | | | d4833ff Bump the protocol version to distinguish new banning behavior. (Suhas Daftuar) 88c3549 Fix compact block handling to not ban if block is invalid (Suhas Daftuar) c93beac [qa] Test that invalid compactblocks don't result in ban (Suhas Daftuar)
| * | | Fix compact block handling to not ban if block is invalidSuhas Daftuar2016-11-031-14/+32
| | | |
* | | | Merge #9045: Hash P2P messages as they are received instead of at process-timePieter Wuille2016-11-071-1/+1
|\ \ \ \ | |_|/ / |/| | | | | | | fe1dc62 Hash P2P messages as they are received instead of at process-time (Matt Corallo)
| * | | Hash P2P messages as they are received instead of at process-timeMatt Corallo2016-10-301-1/+1
| | |/ | |/|
* | | Merge #8709: Allow filterclear messages for enabling TX relay only.Wladimir J. van der Laan2016-11-071-4/+5
|\ \ \ | | | | | | | | | | | | 1f951c6 Allow filterclear messages for enabling TX relay only. (R E Broadley)
| * | | Allow filterclear messages for enabling TX relay only.R E Broadley2016-09-131-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | An example of where this might be useful is allowing a node to connect blocksonly during IBD but then becoming a full-node once caught up with the latest block. This might also even want to be the default behaviour since during IBD most TXs appear to be orphans, and are routinely dropped (for example when a node disconnects). Therefore, this can waste a lot of bandwidth. Additionally, another pull could be written to stop relaying of TXs to nodes that are clearly far behind the latest block and are running a node that doesn't store many orphan TXs, such as recent versions of Bitcoin Core.
* | | | net: handle version push in InitializeNodeCory Fields2016-11-031-4/+30
| | | |
* | | | net: construct CNodeStates in placeCory Fields2016-11-031-6/+6
| | | |
* | | | net: switch all callers to connman for pushing messagesCory Fields2016-11-031-49/+49
| | | | | | | | | | | | | | | | Drop all of the old stuff.
* | | | connman is in charge of pushing messagesCory Fields2016-11-031-7/+7
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The changes here are dense and subtle, but hopefully all is more explicit than before. - CConnman is now in charge of sending data rather than the nodes themselves. This is necessary because many decisions need to be made with all nodes in mind, and a model that requires the nodes calling up to their manager quickly turns to spaghetti. - The per-node-serializer (ssSend) has been replaced with a (quasi-)const send-version. Since the send version for serialization can only change once per connection, we now explicitly tag messages with INIT_PROTO_VERSION if they are sent before the handshake. With this done, there's no need to lock for access to nSendVersion. Also, a new stream is used for each message, so there's no need to lock during the serialization process. - This takes care of accounting for optimistic sends, so the nOptimisticBytesWritten hack can be removed. - -dropmessagestest and -fuzzmessagestest have not been preserved, as I suspect they haven't been used in years.
* | | Merge #8969: Decouple peer-processing-logic from block-connection-logic (#2)Wladimir J. van der Laan2016-11-031-28/+44
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | f5b960b Move nTimeBestReceived updating into net processing code (Matt Corallo) d8670fb Move all calls to CheckBlockIndex out of net-processing logic (Matt Corallo) d6ea737 Remove network state wipe from UnloadBlockIndex. (Matt Corallo) fc0c24f Move MarkBlockAsReceived out of ProcessNewMessage (Matt Corallo) 65f35eb Move FlushStateToDisk call out of ProcessMessages::TX into ATMP (Matt Corallo)
| * | | Move nTimeBestReceived updating into net processing codeMatt Corallo2016-10-311-2/+3
| | | |
| * | | Move all calls to CheckBlockIndex out of net-processing logicMatt Corallo2016-10-311-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This will result in many more calls to CheckBlockIndex when connecting a list of headers (eg in ::HEADERS messages processing) but its only enabled in debug mode, and that should mostly just be during IBD, so it should be OK.
| * | | Remove network state wipe from UnloadBlockIndex.Matt Corallo2016-10-311-9/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | UnloadBlockIndex is only used during init if we end up reindexing to clear our block state so that we can start over. However, at that time no connections have been brought up as CConnman hasn't been started yet, so all of the network processing state logic is empty when its called. Additionally, the initialization of the recentRejects set is moved to InitPeerLogic.
| * | | Move MarkBlockAsReceived out of ProcessNewMessageMatt Corallo2016-10-311-5/+18
| | | |
| * | | Move FlushStateToDisk call out of ProcessMessages::TX into ATMPMatt Corallo2016-10-311-8/+13
| | |/ | |/|
* | | Merge #9053: IBD using chainwork instead of height and not using header ↵Pieter Wuille2016-11-031-7/+8
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | timestamps e141beb IsInitialBlockDownload no longer uses header-only timestamps. (Gregory Maxwell) 2082b55 Remove GetTotalBlocksEstimate and checkpoint tests that test nothing. (Gregory Maxwell) fd46136 IBD check uses minimumchain work instead of checkpoints. (Gregory Maxwell)
| * | | IsInitialBlockDownload no longer uses header-only timestamps.Gregory Maxwell2016-11-021-5/+4
| | | | | | | | | | | | | | | | | | | | This avoids a corner case (mostly visible on testnet) where bogus headers can keep nodes in IsInitialBlockDownload.
| * | | IBD check uses minimumchain work instead of checkpoints.Gregory Maxwell2016-11-021-2/+4
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This introduces a 'minimum chain work' chainparam which is intended to be the known amount of work in the chain for the network at the time of software release. If you don't have this much work, you're not yet caught up. This is used instead of the count of blocks test from checkpoints. This criteria is trivial to keep updated as there is no element of subjectivity, trust, or position dependence to it. It is also a more reliable metric of sync status than a block count.
* | | Merge #9013: Trivial: Explicitly pass const CChainParams& to LoadBlockIndexDB()Wladimir J. van der Laan2016-11-021-4/+3
|\ \ \ | | | | | | | | | | | | d0b01f3 Explicitly pass const CChainParams& to LoadBlockIndexDB() (Geoffrey Tsui)
| * | | Explicitly pass const CChainParams& to LoadBlockIndexDB()Geoffrey Tsui2016-10-251-4/+3
| |/ /
* | | Add DumpMempool and LoadMempoolPieter Wuille2016-10-311-0/+113
| | |
* | | Add AcceptToMemoryPoolWithTime functionPieter Wuille2016-10-301-5/+11
|/ /
* | Merge #8515: A few mempool removal optimizationsWladimir J. van der Laan2016-10-251-8/+7
|\ \ | | | | | | | | | | | | | | | | | | 0334430 Add some missing includes (Pieter Wuille) 4100499 Return shared_ptr<CTransaction> from mempool removes (Pieter Wuille) 51f2783 Make removed and conflicted arguments optional to remove (Pieter Wuille) f48211b Bypass removeRecursive in removeForReorg (Pieter Wuille)
| * | Return shared_ptr<CTransaction> from mempool removesPieter Wuille2016-10-211-5/+5
| | |
| * | Make removed and conflicted arguments optional to removePieter Wuille2016-10-211-3/+2
| | |
* | | Merge #8995: Add missing cs_main lock to ::GETBLOCKTXN processingWladimir J. van der Laan2016-10-241-0/+2
|\ \ \ | | | | | | | | | | | | dfe7906 Add missing cs_main lock to ::GETBLOCKTXN processing (Matt Corallo)
| * | | Add missing cs_main lock to ::GETBLOCKTXN processingMatt Corallo2016-10-211-0/+2
| |/ / | | | | | | | | | | | | | | | | | | | | | Note that this is not a major issue as, in order for the missing lock to cause issues, you have to receive a GETBLOCKTXN message while reindexing, adding a block header via RPC, etc, which results in either a table rehash or an insert into the bucket which you are currently looking at.
* / / Fix doxygen comment: the transaction is returned in txOutPavel Janík2016-10-211-1/+1
|/ /
* | Merge #8968: Don't hold cs_main when calling ProcessNewBlock from a cmpctblockWladimir J. van der Laan2016-10-211-21/+26
|\ \ | | | | | | | | | 72ca7d9 Don't hold cs_main when calling ProcessNewBlock from a cmpctblock (Matt Corallo)
| * | Don't hold cs_main when calling ProcessNewBlock from a cmpctblockMatt Corallo2016-10-181-21/+26
| | |
* | | Use pindexBestHeader instead of setBlockIndexCandidates for NotifyHeaderTip()Jonas Schnelli2016-10-201-3/+2
| | |
* | | RPC: augment getblockchaininfo bip9_softforks datamruddy2016-10-191-0/+6
| | |
* | | Merge #8936: Report NodeId in misbehaving debugWladimir J. van der Laan2016-10-191-2/+2
|\ \ \ | | | | | | | | | | | | a1919ad Report NodeId in misbehaving debug (R E Broadley)
| * | | Report NodeId in misbehaving debugR E Broadley2016-10-181-2/+2
| | | |
* | | | Merge #8865: Decouple peer-processing-logic from block-connection-logicWladimir J. van der Laan2016-10-181-57/+65
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a9aec5c Use BlockChecked signal to send reject messages from mapBlockSource (Matt Corallo) 7565e03 Remove SyncWithWallets wrapper function (Matt Corallo) 12ee1fe Always call UpdatedBlockTip, even if blocks were only disconnected (Matt Corallo) f5efa28 Remove CConnman parameter from ProcessNewBlock/ActivateBestChain (Matt Corallo) fef1010 Use CValidationInterface from chain logic to notify peer logic (Matt Corallo) aefcb7b Move net-processing logic definitions together in main.h (Matt Corallo) 0278fb5 Remove duplicate nBlocksEstimate cmp (we already checked IsIBD()) (Matt Corallo) 87e7d72 Make validationinterface.UpdatedBlockTip more verbose (Matt Corallo)
| * | | | Use BlockChecked signal to send reject messages from mapBlockSourceMatt Corallo2016-10-041-12/+20
| | | | |
| * | | | Remove SyncWithWallets wrapper functionMatt Corallo2016-10-041-4/+4
| | | | |
| * | | | Always call UpdatedBlockTip, even if blocks were only disconnectedMatt Corallo2016-10-041-7/+4
| | | | |
| * | | | Remove CConnman parameter from ProcessNewBlock/ActivateBestChainMatt Corallo2016-10-041-5/+5
| | | | |
| * | | | Use CValidationInterface from chain logic to notify peer logicMatt Corallo2016-10-041-24/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a new CValidationInterface subclass, defined in main.h, to receive notifications of UpdatedBlockTip and use that to push blocks to peers, instead of doing it directly from ActivateBestChain.
| * | | | Remove duplicate nBlocksEstimate cmp (we already checked IsIBD())Matt Corallo2016-10-041-5/+2
| | | | |
| * | | | Make validationinterface.UpdatedBlockTip more verboseMatt Corallo2016-10-041-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In anticipation of making all the callbacks out of block processing flow through it. Note that vHashes will always have something in it since pindexFork != pindexNewTip.