aboutsummaryrefslogtreecommitdiff
path: root/src/protocol.h
Commit message (Collapse)AuthorAgeFilesLines
* Re-introduce alert functionality (#1470)Ross Nicoll2018-09-191-0/+7
| | | Re-introduce alert functionality removed from Bitcoin upstream
* 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
|
* Introduce a CChainParameters singleton class and regtest mode.Mike Hearn2013-06-191-10/+1
| | | | | | | | | | | | | The new class is accessed via the Params() method and holds most things that vary between main, test and regtest networks. The regtest mode has two purposes, one is to run the bitcoind/bitcoinj comparison tool which compares two separate implementations of the Bitcoin protocol looking for divergence. The other is that when run, you get a local node which can mine a single block instantly, which is highly convenient for testing apps during development as there's no need to wait 10 minutes for a block on the testnet.
* Use per-message send buffer, rather than per connectionPieter Wuille2013-03-291-1/+2
|
* Relay CMerkleBlocks when asked for MSG_FILTERED_BLOCKMatt Corallo2013-01-161-0/+3
|
* Abstract block hash substr extraction (for debug.log) into BlockHashStr inlineLuke Dashjr2012-11-131-0/+6
|
* Fix remaining warnings.Matt Corallo2012-07-041-2/+10
|
* Update License in File HeadersFordy2012-05-181-1/+1
| | | | | | I originally created a pull to replace the "COPYING" in crypter.cpp and crypter.h, but it turned out that COPYING was actually the correct file.
* Move proto version to version.h. Reduce header deps a bit more.Jeff Garzik2012-04-171-1/+0
|
* Replace several network protocol version numbers with named constantsJeff Garzik2012-04-121-3/+4
| | | | | | | stored in version.h. Also, a minor CAddress code reformat while we're in there, fixing some incorrect indentation.