aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
AgeCommit message (Collapse)Author
2016-10-13Use cmpctblock type 2 for segwit-enabled transferPieter Wuille
Contains version negotiation logic by Matt Corallo and bugfixes by Suhas Daftuar. Github-Pull: #8393 Rebased-From: 6aa28abf53ef4694692474b4a3b0a8fa7559b50b
2016-10-13net: fix a few cases where messages were sent rather than dropped upon ↵Cory Fields
disconnection 75ead758 turned these into crashes in the event of a handshake failure, most notably when a peer does not offer the expected services. There are likely other cases that these assertions will find as well. Github-Pull: #8862 Rebased-From: 905bc68d05595f41cca36b3df83accd10c00cc48
2016-09-26Implement NULLDUMMY softforkJohnson Lau
Github-Pull: #8636 Rebased-From: 482f852da65457eb2fbea6b259e7568133fb81c4
2016-09-26Do not store witness txn in rejection cachePieter Wuille
Github-Pull: #8525 Rebased-From: 34521e4d7d176109dedf52ec8ef2b5052b9a30f3
2016-09-21UndoReadFromDisk works on undo files (rev), not on block files.Pavel Janík
Github-Pull: #8737 Rebased-From: b4fb51271905f9ef39e5c2bc7e8c15e7489394a1
2016-09-21Use __func__ to get function name for output printingMarcoFalke
Github-Pull: #8548 Rebased-From: fa785d121152c652d0704ac32ce8611262e609d2
2016-09-21various typosleijurv
Github-Pull: #8505 Rebased-From: 1aacfc2da521a8e0d718e9ac561d9b2d7916eb0b
2016-09-21Use a signal to continue init after genesis activationPieter Wuille
Github-Pull: #8392 Rebased-From: 0fd2a33648ccde4b989f1d69529daea4d88b14a2
2016-09-21net: Ignore `notfound` P2P messagesWladimir J. van der Laan
Github-Pull: #8427 Rebased-From: 5c9e49d12c931f9c7ddaac0144739dcd7263e554
2016-09-13fix op order to append first alertrodasmith
Github-Pull: #8697 Rebased-From: 1d635ae61b26d1dd613c1cc1cac796627af2a31e
2016-09-07Do not add random inbound peers to addrman.Gregory Maxwell
We should learn about new peers via address messages. An inbound peer connecting to us tells us nothing about its ability to accept incoming connections from us, so we shouldn't assume that we can connect to it based on this. The vast majority of nodes on the network do not accept incoming connections, adding them will only slow down the process of making a successful connection in the future. Nodes which have configured themselves to not announce would prefer we not violate their privacy by announcing them in GETADDR responses.
2016-09-07Fix some locksPieter Wuille
This makes sure that cs_filter is never held while taking cs_main or CNode::cs_vSend.
2016-09-07Check for compatibility with download in FindNextBlocksToDownloadPieter Wuille
2016-09-07Precompute sighashesPieter Wuille
Original version by Nicolas Dorier. Precomputing version by Pieter Wuille.
2016-09-07[Qt] show network/chain errors in the GUIJonas Schnelli
2016-09-07Added feeler connections increasing good addrs in the tried table.Ethan Heilman
Tests if addresses are online or offline by briefly connecting to them. These short lived connections are referred to as feeler connections. Feeler connections are designed to increase the number of fresh online addresses in tried by selecting and connecting to addresses in new. One feeler connection is attempted on average once every two minutes. This change was suggested as Countermeasure 4 in Eclipse Attacks on Bitcoin’s Peer-to-Peer Network, Ethan Heilman, Alison Kendler, Aviv Zohar, Sharon Goldberg. ePrint Archive Report 2015/263. March 2015.
2016-07-31Treat high-sigop transactions as larger rather than rejecting themPieter Wuille
2016-07-29Prevent fingerprinting, disk-DoS with compact blocksSuhas Daftuar
- Ignore GETBLOCKTXN requests for unknown blocks Don't disconnect peers, or else we leak information that could be used for fingerprinting. - Ignore CMPCTBLOCK messages for pruned blocks Also ignores CMPCTBLOCK announcements that have too little work. This is to prevent disk-exhaustion DoS. Github-Pull: #8408 Rebased-From: 1de2a46632946990a7863020b61172232f8c5796 1d06e49834814eed45e07393dcffd7b6683311b2
2016-07-26Make witness v0 outputs non-standard before segwit activationJohnson Lau
Github-Pull: #8381 Rebased-From: 1ffaff2f747af683513d6d74a7241d41e3f6e051
2016-07-19Rename "block cost" to "block weight"Suhas Daftuar
Github-Pull: #8363 Rebased-From: 2c06bae39edfaa9c0855d83377ad8fda09e4fa08
2016-07-18Merge #8305: Improve handling of unconnecting headersWladimir J. van der Laan
e91cf4b Add test for handling of unconnecting headers (Suhas Daftuar) 96fa953 Improve handling of unconnecting headers (Suhas Daftuar)
2016-07-14Merge #8312: Fix mempool DoS vulnerability from malleated transactionsWladimir J. van der Laan
46c9620 Test that unnecessary witnesses can't be used for mempool DoS (Suhas Daftuar) bb66a11 Fix DoS vulnerability in mempool acceptance (Suhas Daftuar)
2016-07-14Merge #8271: [bugfix] Do not send witnesses in cmpctblockWladimir J. van der Laan
252675e Do not send witnesses in cmpctblock (Pieter Wuille)
2016-07-12Improve handling of unconnecting headersSuhas Daftuar
When processing a headers message that looks like a block announcement, send peer a getheaders if the headers message won't connect. Apply DoS points after too many consecutive unconnecting headers messages.
2016-07-07Fix DoS vulnerability in mempool acceptanceSuhas Daftuar
Moves the IsStandard check to happen after the premature-witness check, so that adding a witness to a transaction can't prevent mempool acceptance. Note that this doesn't address the broader category of potential mempool DoS issues that affect transactions after segwit activation.
2016-07-06Merge #8275: Remove bad chain alert partition checkWladimir J. van der Laan
ab8be98 Remove bad chain alert partition check (BtcDrak)
2016-07-05Revert "net: Avoid duplicate getheaders requests." PR #8054Gregory Maxwell
This reverts commit f93c2a1b7ee912f0651ebb4c8a5eca220e434f4a. This can cause synchronization to get stuck.
2016-06-26Do not send witnesses in cmpctblockPieter Wuille
2016-06-22[qa] Add rpc test for segwitAlex Morcos
Amended by Pieter Wuille to use multisig 1-of-1 for P2WSH tests, and BIP9 based switchover logic. Fixes and py3 conversion by Marco Falke.
2016-06-22Do not use compact blocks when segwit is enabledPieter Wuille
2016-06-22Add rewind logic to deal with post-fork software updatesPieter Wuille
Includes logic for dealing with pruning by Suhas Daftuar.
2016-06-22BIP141: Other consensus critical limits, and BIP145Pieter Wuille
Includes changes by Suhas Daftuar, Luke-jr, and mruddy.
2016-06-22Refactor script validation to observe amountsPieter Wuille
This is a preparation for BIP143 support.
2016-06-22BIP144: Handshake and relay (receiver side)Pieter Wuille
Service bit logic by Nicolas Dorier. Only download blocks from witness peers after fork.
2016-06-22BIP141: Commitment structure and deploymentPieter Wuille
Includes a fix by Suhas Daftuar and LongShao007
2016-06-22BIP141: Witness programPieter Wuille
2016-06-22BIP144: Serialization, hashes, relay (sender side)Pieter Wuille
Contains refactorings by Eric Lombrozo. Contains fixup by Nicolas Dorier. Contains cleanup of CInv::GetCommand by Alex Morcos
2016-06-22Merge #8068: Compact BlocksWladimir J. van der Laan
48efec8 Fix some minor compact block issues that came up in review (Matt Corallo) ccd06b9 Elaborate bucket size math (Pieter Wuille) 0d4cb48 Use vTxHashes to optimize InitData significantly (Matt Corallo) 8119026 Provide a flat list of txid/terators to txn in CTxMemPool (Matt Corallo) 678ee97 Add BIP 152 to implemented BIPs list (Matt Corallo) 56ba516 Add reconstruction debug logging (Matt Corallo) 2f34a2e Get our "best three" peers to announce blocks using cmpctblocks (Matt Corallo) 927f8ee Add ability to fetch CNode by NodeId (Matt Corallo) d25cd3e Add receiver-side protocol implementation for CMPCTBLOCK stuff (Matt Corallo) 9c837d5 Add sender-side protocol implementation for CMPCTBLOCK stuff (Matt Corallo) 00c4078 Add protocol messages for short-ids blocks (Matt Corallo) e3b2222 Add some blockencodings tests (Matt Corallo) f4f8f14 Add TestMemPoolEntryHelper::FromTx version for CTransaction (Matt Corallo) 85ad31e Add partial-block block encodings API (Matt Corallo) 5249dac Add COMPACTSIZE wrapper similar to VARINT for serialization (Matt Corallo) cbda71c Move context-required checks from CheckBlockHeader to Contextual... (Matt Corallo) 7c29ec9 If AcceptBlockHeader returns true, pindex will be set. (Matt Corallo) 96806c3 Stop trimming when mapTx is empty (Pieter Wuille)
2016-06-21Fix some minor compact block issues that came up in reviewMatt Corallo
2016-06-20Merge #8179: Evict orphans which are included or precluded by accepted blocks.Wladimir J. van der Laan
54326a6 Increase maximum orphan size to 100,000 bytes. (Gregory Maxwell) 8c99d1b Treat orphans as implicit inv for parents, discard when parents rejected. (Gregory Maxwell) 11cc143 Adds an expiration time for orphan tx. (Gregory Maxwell) db0ffe8 This eliminates the primary leak that causes the orphan map to always grow to its maximum size. (Gregory Maxwell) 1b0bcc5 Track orphan by prev COutPoint rather than prev hash (Pieter Wuille)
2016-06-19Get our "best three" peers to announce blocks using cmpctblocksMatt Corallo
2016-06-19Add receiver-side protocol implementation for CMPCTBLOCK stuffMatt Corallo
2016-06-19Add sender-side protocol implementation for CMPCTBLOCK stuffMatt Corallo
2016-06-19Move context-required checks from CheckBlockHeader to Contextual...Matt Corallo
2016-06-19If AcceptBlockHeader returns true, pindex will be set.Matt Corallo
Assert this instead of checking (and then dref'ing later anyway) to make sure no one thinks they can change that postcondition of AcceptBlockHeader..
2016-06-16Merge #8084: Add recently accepted blocks and txn to AttemptToEvictConnection.Wladimir J. van der Laan
6ee7f05 Allow disconnecting a netgroup with only one member in eviction. (Gregory Maxwell) 5d0ca81 Add recently accepted blocks and txn to AttemptToEvictConnection. (Gregory Maxwell)
2016-06-15Add recently accepted blocks and txn to AttemptToEvictConnection.Gregory Maxwell
This protects any not-already-protected peers who were the most recent four to relay transactions and most recent four to send blocks to us.
2016-06-15Increase maximum orphan size to 100,000 bytes.Gregory Maxwell
Although this increases node memory usage in the worst case by perhaps 30MB, the current behavior causes severe issues with dependent tx relay.
2016-06-15Treat orphans as implicit inv for parents, discard when parents rejected.Gregory Maxwell
An orphan whos parents were rejected is never going to connect, so there is little utility in keeping it. Orphans also helpfully tell us what we're missing, so go ahead and treat it as INVed.
2016-06-15Adds an expiration time for orphan tx.Gregory Maxwell
This prevents higher order orphans and other junk from holding positions in the orphan map. Parents delayed twenty minutes are more are unlikely to ever arrive. The freed space will improve the orphan matching success rate for other transactions.