aboutsummaryrefslogtreecommitdiff
path: root/src/protocol.h
Commit message (Collapse)AuthorAgeFilesLines
...
| * | Use GetDesireableServiceFlags in static seeds, document this.Matt Corallo2018-01-191-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 44407100f broke inserting entries into addrman from static seeds (as well as dnsseeds which did not support service bits). Static seeds were already being filtered by UA for 0.13.1+ (ie NODE_WITNESS), so simply changing the default service bits to include NODE_WITNESS (and updating docs appropriately) is sufficient. For DNS Seeds, we will later fix by falling back to oneshot if a seed does not support filtering.
* | | Increment MIT Licence copyright header year on files modified in 2017Akira Takizawa2018-01-031-1/+1
|/ /
* | Add NODE_NETWORK_LIMITED flags and min block amount constantsJonas Schnelli2017-12-051-3/+6
| |
* | scripted-diff: Replace #include "" with #include <> (ryanofsky)MeshCollider2017-11-161-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -BEGIN VERIFY SCRIPT- for f in \ src/*.cpp \ src/*.h \ src/bench/*.cpp \ src/bench/*.h \ src/compat/*.cpp \ src/compat/*.h \ src/consensus/*.cpp \ src/consensus/*.h \ src/crypto/*.cpp \ src/crypto/*.h \ src/crypto/ctaes/*.h \ src/policy/*.cpp \ src/policy/*.h \ src/primitives/*.cpp \ src/primitives/*.h \ src/qt/*.cpp \ src/qt/*.h \ src/qt/test/*.cpp \ src/qt/test/*.h \ src/rpc/*.cpp \ src/rpc/*.h \ src/script/*.cpp \ src/script/*.h \ src/support/*.cpp \ src/support/*.h \ src/support/allocators/*.h \ src/test/*.cpp \ src/test/*.h \ src/wallet/*.cpp \ src/wallet/*.h \ src/wallet/test/*.cpp \ src/wallet/test/*.h \ src/zmq/*.cpp \ src/zmq/*.h do base=${f%/*}/ relbase=${base#src/} sed -i "s:#include \"\(.*\)\"\(.*\):if test -e \$base'\\1'; then echo \"#include <\"\$relbase\"\\1>\\2\"; else echo \"#include <\\1>\\2\"; fi:e" $f done -END VERIFY SCRIPT-
* | Merge #10749: Use compile-time constants instead of unnamed enumerations ↵MarcoFalke2017-11-111-10/+7
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (remove "enum hack") 1e65f0f33 Use compile-time constants instead of unnamed enumerations (remove "enum hack") (practicalswift) Pull request description: Use compile-time constants instead of unnamed enumerations (remove "enum hack"). Tree-SHA512: 1b6ebb2755398c5ebab6cce125b1dfc39cbd1504d98d55136b32703fe935c4070360ab3b2f52b1da48ba9f3b01082d204f3d87c92ccb5c8c333731f7f972e128
| * | Use compile-time constants instead of unnamed enumerations (remove "enum hack")practicalswift2017-07-261-10/+7
| | |
* | | Replace relevant services logic with a function suite.Matt Corallo2017-10-131-0/+37
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds HasAllRelevantServices and GetRelevantServices, which check for NETWORK|WITNESS. This changes the following: * Removes nRelevantServices from CConnman, disconnecting it a bit more from protocol-level logic. * Replaces our sometimes-connect-to-!WITNESS-nodes logic with simply always requiring WITNESS|NETWORK for outbound non-feeler connections (feelers still only require NETWORK). * This has the added benefit of removing nServicesExpected from CNode - instead letting net_processing's VERSION message handling simply check HasAllRelevantServices. * This implies we believe WITNESS nodes to continue to be a significant majority of nodes on the network, but also because we cannot sync properly from !WITNESS nodes, it is strange to continue using our valuable outbound slots on them. * In order to prevent this change from preventing connection to -connect= nodes which have !WITNESS, -connect nodes are now given the "addnode" flag. This also allows outbound connections to !NODE_NETWORK nodes for -connect nodes (which was already true of addnodes). * Has the (somewhat unintended) consequence of changing one of the eviction metrics from the same sometimes-connect-to-!WITNESS-nodes metric to requiring HasRelevantServices. This should make NODE_NETWORK_LIMITED much simpler to implement.
* | Declare single-argument (non-converting) constructors "explicit"practicalswift2017-08-161-1/+1
|/ | | | In order to avoid unintended implicit conversions.
* Fix incorrect Doxygen tag (@ince → @since). Make Doxygen parameter names ↵practicalswift2017-07-161-1/+1
| | | | match actual parameter names.
* Increment MIT Licence copyright header year on files modified in 2016isle29832016-12-311-1/+1
| | | | | | Edited via: $ contrib/devtools/copyright_header.py update .
* Minor change to comment above new NODE_WITNESS service flag to keep it ↵Greg Walker2016-11-221-1/+1
| | | | consitent with existing comment structure. Helps with readability.
* Get rid of nType and nVersionPieter Wuille2016-11-071-6/+7
| | | | | | | | | | | Remove the nType and nVersion as parameters to all serialization methods and functions. There is only one place where it's read and has an impact (in CAddress), and even there it does not impact any of the recursively invoked serializers. Instead, the few places that need nType or nVersion are changed to read it directly from the stream object, through GetType() and GetVersion() methods which are added to all stream classes.
* protocol.h: Make enums in GetDataMsg concrete valuesWladimir J. van der Laan2016-10-051-8/+12
| | | | | | | | | This concretizes the numbers and adds a comment to make it clear that these numbers are fixed by the protocol, and may avoid people forgetting to claim numbers in the future (e.g. issue #8500). Also gets rid of a weird unused `MSG_TYPE_MAX` in the middle of the enumeration (thanks @paveljanik for noticing).
* protocol.h: Move MESSAGE_START_SIZE into CMessageHeaderWladimir J. van der Laan2016-10-041-13/+10
| | | | | Also move the enum to the top, and remove a deceptive TODO comment.
* net: Hardcode protocol sizes and use fixed-size typesWladimir J. van der Laan2016-09-281-3/+3
| | | | | The P2P network uses a fixed protocol, these sizes shouldn't change based on what happens to be the architecture.
* net: Consistent checksum handlingWladimir J. van der Laan2016-09-281-2/+2
| | | | | | | | | | | | In principle, the checksums of P2P packets are simply 4-byte blobs which are the first four bytes of SHA256(SHA256(payload)). Currently they are handled as little-endian 32-bit integers half of the time, as blobs the other half, sometimes copying the one to the other, resulting in somewhat confused code. This PR changes the handling to be consistent both at packet creation and receiving, making it (I think) easier to understand.
* Show XTHIN in GUIR E Broadley2016-08-251-0/+3
|
* net: narrow include scope after moving to netaddressCory Fields2016-07-311-1/+1
| | | | | Net functionality is no longer needed for CAddress/CAddrman/etc. now that CNetAddr/CService/CSubNet are dumb storage classes.
* BIP144: Handshake and relay (receiver side)Pieter Wuille2016-06-221-0/+3
| | | | | | Service bit logic by Nicolas Dorier. Only download blocks from witness peers after fork.
* BIP144: Serialization, hashes, relay (sender side)Pieter Wuille2016-06-221-12/+18
| | | | | | Contains refactorings by Eric Lombrozo. Contains fixup by Nicolas Dorier. Contains cleanup of CInv::GetCommand by Alex Morcos
* Add protocol messages for short-ids blocksMatt Corallo2016-06-191-2/+29
|
* Introduce enum ServiceFlags for service flagsPieter Wuille2016-06-131-4/+8
|
* Don't require services in -addnodePieter Wuille2016-06-131-1/+1
|
* Implement "feefilter" P2P message.Alex Morcos2016-03-211-1/+6
| | | | The "feefilter" p2p message is used to inform other nodes of your mempool min fee which is the feerate that any new transaction must meet to be accepted to your mempool. This will allow them to filter invs to you according to this feerate.
* protocol.h/cpp: Removes NetMsgType::ALERTThomas Kerin2016-03-181-7/+0
|
* Merge pull request #7205Wladimir J. van der Laan2016-01-051-1/+1
|\ | | | | | | | | | | fa71669 [devtools] Use git pretty-format for year parsing (MarcoFalke) fa24439 Bump copyright headers to 2015 (MarcoFalke) fa6ad85 [devtools] Rewrite fix-copyright-headers.py (MarcoFalke)
| * Bump copyright headers to 2015MarcoFalke2015-12-131-1/+1
| |
* | net: Add and document network messages in protocol.hWladimir J. van der Laan2015-12-101-0/+159
|/ | | | | | | | | - 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.
* Add NODE_BLOOM service bit and bump protocol versionMatt Corallo2015-09-051-0/+4
| | | | | | | | | | | | | | | | Lets nodes advertise that they offer bloom filter support explicitly. The protocol version bump allows SPV nodes to assume that NODE_BLOOM is set if NODE_NETWORK is set for pre-70011 nodes. Also adds an option to turn bloom filter support off for nodes which advertise a version number >= 70011. Nodes attempting to use bloom filters on such protocol versions are banned, and a later upgade should drop nodes of an older version which attempt to use bloom filters. Much code stolen from Peter Todd. Implements BIP 111
* nLastTry is only used for addrman entriesPieter Wuille2015-04-191-3/+0
| | | | No need to define it for every CAddress, as it's memory only anyway.
* Add a NODE_GETUTXO service bit and document NODE_NETWORK.Mike Hearn2015-03-211-0/+7
| | | | Stop translating the NODE_* names as they are technical and cannot be translated.
* make CMessageHeader a dumb storage classCory Fields2015-02-251-3/+5
| | | | It shouldn't know or care about bitcoind's chain param selection
* Added "Core" to copyright headerssandakersmann2014-12-191-1/+1
| | | | | Github-Pull: #5494 Rebased-From: 15de949bb9277e442302bdd8dee299a8d6deee60
* Remove references to X11 licenceMichael Ford2014-12-161-1/+1
|
* Fix all header definesPavel Janík2014-11-031-3/+3
|
* Apply clang-format on some infrequently-updated filesPieter Wuille2014-09-191-75/+76
|
* Rename IMPLEMENT_SERIALIZE to ADD_SERIALIZE_METHODSPieter Wuille2014-09-021-3/+3
|
* Serializer simplifications after IMPLEMENT_SERIALIZE overhaulPieter Wuille2014-09-011-6/+3
|
* Use CSizeComputer to avoid counting sizes in SerializationOpPieter Wuille2014-08-311-13/+5
|
* rework overhauled serialization methods to non-staticKamil Domanski2014-08-311-18/+18
| | | | | | | Thanks to Pieter Wuille for most of the work on this commit. I did not fixup the overhaul commit, because a rebase conflicted with "remove fields of ser_streamplaceholder". I prefer not to risk making a mistake while resolving it.
* overhaul serialization codeKamil Domanski2014-08-311-23/+38
| | | | | | | | | | | | | | | | | | | | | The implementation of each class' serialization/deserialization is no longer passed within a macro. The implementation now lies within a template of form: template <typename T, typename Stream, typename Operation> inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) { size_t nSerSize = 0; /* CODE */ return nSerSize; } In cases when codepath should depend on whether or not we are just deserializing (old fGetSize, fWrite, fRead flags) an additional clause can be used: bool fRead = boost::is_same<Operation, CSerActionUnserialize>(); The IMPLEMENT_SERIALIZE macro will now be a freestanding clause added within class' body (similiar to Qt's Q_OBJECT) to implement GetSerializeSize, Serialize and Unserialize. These are now wrappers around the "SerializationOp" template.
* Revert "Add a getutxos command to the p2p protocol. It allows querying of ↵Wladimir J. van der Laan2014-08-271-1/+0
| | | | | | the UTXO set" This reverts commit da2ec100f3681176f60dec6dc675fc64147ade3a.
* Merge pull request #4351Wladimir J. van der Laan2014-08-251-0/+1
|\ | | | | | | da2ec10 Add a getutxos command to the p2p protocol. It allows querying of the UTXO set given a set of outpoints. (Mike Hearn)
| * Add a getutxos command to the p2p protocol. It allows querying of the UTXO setMike Hearn2014-08-111-0/+1
| | | | | | | | given a set of outpoints.
* | Remove all other print() methodsWladimir J. van der Laan2014-08-201-3/+0
|/ | | | All unused.
* Add comment regarding experimental-use service bitsPeter Todd2014-06-211-0/+8
| | | | As per mailing list discussion.
* Replace virtual methods with static attributes, chainparams.h depends onjtimon2014-06-041-1/+2
| | | | protocol.h instead of the other way around
* Reduce bignum.h now it is only needed for scriptnum_testsPieter Wuille2014-05-091-0/+1
|
* Cleanup code using forward declarations.Brandon Dahler2013-11-101-5/+7
| | | | | | | | | Use misc methods of avoiding unnecesary header includes. Replace int typedefs with int##_t from stdint.h. Replace PRI64[xdu] with PRI[xdu]64 from inttypes.h. Normalize QT_VERSION ifs where possible. Resolve some indirect dependencies as direct ones. Remove extern declarations from .cpp files.
* Bump Year Number to 2013super32013-10-201-1/+1
|