aboutsummaryrefslogtreecommitdiff
path: root/src/net_processing.cpp
AgeCommit message (Collapse)Author
2017-01-05Break addnode out from the outbound connection limits.Gregory Maxwell
Previously addnodes were in competition with outbound connections for access to the eight outbound slots. One result of this is that frequently a node with several addnode configured peers would end up connected to none of them, because while the addnode loop was in its two minute sleep the automatic connection logic would fill any free slots with random peers. This is particularly unwelcome to users trying to maintain links to specific nodes for fast block relay or purposes. Another result is that a group of nine or more nodes which are have addnode configured towards each other can become partitioned from the public network. This commit introduces a new limit of eight connections just for addnode peers which is not subject to any of the other connection limitations (including maxconnections). The choice of eight is sufficient so that under no condition would a user find themselves connected to fewer addnoded peers than previously. It is also low enough that users who are confused about the significance of more connections and have gotten too copy-and-paste happy will not consume more than twice the slot usage of a typical user. Any additional load on the network resulting from this will likely be offset by a reduction in users applying even more wasteful workaround for the prior behavior. The retry delays are reduced to avoid nodes sitting around without their added peers up, but are still sufficient to prevent overly aggressive repeated connections. The reduced delays also make the system much more responsive to the addnode RPC. Ban-disconnects are also exempted for peers added via addnode since the outbound addnode logic ignores bans. Previously it would ban an addnode then immediately reconnect to it. A minor change was also made to CSemaphoreGrant so that it is possible to re-acquire via an object whos grant was moved.
2017-01-04Merge #9283: A few more CTransactionRef optimizationsWladimir J. van der Laan
91335ba Remove unused MakeTransactionRef overloads (Pieter Wuille) 6713f0f Make FillBlock consume txn_available to avoid shared_ptr copies (Pieter Wuille) 62607d7 Convert COrphanTx to keep a CTransactionRef (Pieter Wuille) c44e4c4 Make AcceptToMemoryPool take CTransactionRef (Pieter Wuille)
2017-01-03net: remove thread_interrupted catchCory Fields
This is now a std::thread, so there's no hope of catching a boost interruption point.
2017-01-03net: make net processing interruptibleCory Fields
2017-01-03Merge #9252: Release cs_main before calling ProcessNewBlock, or processing ↵Pieter Wuille
headers (cmpctblock handling) bd02bdd Release cs_main before processing cmpctblock as header (Suhas Daftuar) 680b0c0 Release cs_main before calling ProcessNewBlock (cmpctblock handling) (Suhas Daftuar)
2016-12-26Release cs_main before processing cmpctblock as headerSuhas Daftuar
2016-12-26Release cs_main before calling ProcessNewBlock (cmpctblock handling)Suhas Daftuar
2016-12-24Un-expose mapArgs from utils.hMatt Corallo
2016-12-23Introduce (and use) an IsArgSet accessor methodMatt Corallo
2016-12-21Convert COrphanTx to keep a CTransactionRefPieter Wuille
2016-12-21Make AcceptToMemoryPool take CTransactionRefPieter Wuille
2016-12-21Merge #8589: Inline CTxInWitness inside CTxInWladimir J. van der Laan
f6fb7ac Move CTxInWitness inside CTxIn (Pieter Wuille)
2016-12-19Merge #9352: Attempt reconstruction from all compact block announcementsWladimir J. van der Laan
813ede9 [qa] Update compactblocks test for multi-peer reconstruction (Suhas Daftuar) 7017298 Allow compactblock reconstruction when block is in flight (Suhas Daftuar)
2016-12-16If we don't allow free txs, always send a fee filter (take 2)MarcoFalke
2016-12-15Merge #9313: If we don't allow free txs, always send a fee filterWladimir J. van der Laan
01fea7a If we don't allow free txs, always send a fee filter (Alex Morcos)
2016-12-15Allow compactblock reconstruction when block is in flightSuhas Daftuar
2016-12-14Merge #9273: Remove unused CDiskBlockPos* argument from ProcessNewBlockWladimir J. van der Laan
a13fa4c Remove unused CDiskBlockPos* argument from ProcessNewBlock (Matt Corallo)
2016-12-14Do not run functions with necessary side-effects in assert()Gregory Maxwell
2016-12-09If we don't allow free txs, always send a fee filterAlex Morcos
2016-12-06Merge #9268: Fix rounding privacy leak introduced in #9260Pieter Wuille
9b9324e Fix rounding privacy leak introduced in #9260 (Matt Corallo)
2016-12-05Merge #9269: Align struct COrphan definitionWladimir J. van der Laan
2efc438 Align struct COrphan definition (Pieter Wuille)
2016-12-05Align struct COrphan definitionPieter Wuille
2016-12-04Move CTxInWitness inside CTxInPieter Wuille
2016-12-05Merge #9014: Fix block-connection performance regressionWladimir J. van der Laan
dd0df81 Document ConnectBlock connectTrace postconditions (Matt Corallo) 2d6e561 Switch pblock in ProcessNewBlock to a shared_ptr (Matt Corallo) 2736c44 Make the optional pblock in ActivateBestChain a shared_ptr (Matt Corallo) ae4db44 Create a shared_ptr for the block we're connecting in ActivateBCS (Matt Corallo) fd9d890 Keep blocks as shared_ptrs, instead of copying txn in ConnectTip (Matt Corallo) 6fdd43b Add struct to track block-connect-time-generated info for callbacks (Matt Corallo)
2016-12-04Remove unused CDiskBlockPos* argument from ProcessNewBlockMatt Corallo
2016-12-04Switch pblock in ProcessNewBlock to a shared_ptrMatt Corallo
This (finally) fixes a performance regression in b3b3c2a5623d5c942d2b3565cc2d833c65105555
2016-12-02Fix rounding privacy leak introduced in #9260Matt Corallo
2016-12-02Make CTransaction actually immutablePieter Wuille
2016-12-02Rename the remaining main.{h,cpp} to validation.{h,cpp}Matt Corallo
2016-12-02Move network-msg-processing code out of main to its own fileMatt Corallo