aboutsummaryrefslogtreecommitdiff
path: root/src/protocol.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Re-introduce alert functionality (#1470)Ross Nicoll2018-09-191-0/+2
| | | 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 .
* Avoid ugly exception in log on unknown inv typeWladimir J. van der Laan2016-11-091-1/+5
| | | | | | | | | It is unexpected behavior for `ToString` to raise an exception. It is expected to do a best-effort attempt at formatting but never fail. Catch the exception and simply print unknown inv types as hexadecimal. Fixes #9110.
* 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.
* BIP144: Serialization, hashes, relay (sender side)Pieter Wuille2016-06-221-33/+13
| | | | | | 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/+11
|
* Introduce enum ServiceFlags for service flagsPieter Wuille2016-06-131-2/+2
|
* Don't require services in -addnodePieter Wuille2016-06-131-1/+1
|
* Implement "feefilter" P2P message.Alex Morcos2016-03-211-1/+3
| | | | 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-2/+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-4/+63
|/ | | | | | | | | - 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.
* nLastTry is only used for addrman entriesPieter Wuille2015-04-191-1/+0
| | | | No need to define it for every CAddress, as it's memory only anyway.
* make CMessageHeader a dumb storage classCory Fields2015-02-251-7/+6
| | | | It shouldn't know or care about bitcoind's chain param selection
* Remove whitespaces before double colon in errors and logsPavel Janík2015-01-311-3/+3
|
* Replace direct use of 0 with SetNull and IsNullWladimir J. van der Laan2015-01-051-1/+1
| | | | | | Replace x=0 with .SetNull(), x==0 with IsNull(), x!=0 with !IsNull(). Replace uses of uint256(0) with uint256().
* 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
|
* script: add a slew of includes all around and drop includes from script.hCory Fields2014-10-171-0/+1
| | | | Lots of files ended up with indirect includes from script.h.
* CMessageHeader sanity changesWladimir J. van der Laan2014-09-181-5/+2
| | | | | | | - Remove spurious `pchCommand[1] = 1` in CMessageHeader() - Make sure that pchCommand is zero-padded if length is shorter than COMMAND_SIZE - Use strnlen to determine length of pcmCommand in GetCommand
* Remove all other print() methodsWladimir J. van der Laan2014-08-201-6/+0
| | | | All unused.
* Replace virtual methods with static attributes, chainparams.h depends onjtimon2014-06-041-0/+1
| | | | protocol.h instead of the other way around
* Copyright header updates s/2013/2014 on files whose last git commit was done ↵gubatron2014-02-091-1/+1
| | | | | | in 2014. contrib/devtools/fix-copyright-headers.py script to be able to perform this maintenance task with ease during the rest of the year, every year. Modifications to contrib/devtools/README.md to document what fix-copyright-headers.py does.
* Remove redundant .c_str()sWladimir J. van der Laan2014-01-231-4/+4
| | | | | | | After the tinyformat switch sprintf() family functions support passing actual std::string objects. Remove unnecessary c_str calls (236 of them) in logging and formatting.
* core: remove includes in .cpp, if header is already in .hPhilip Kaufmann2013-11-151-2/+0
| | | | | - example: if util.h includes stdint.h, remove it from util.cpp, as util.h is the first header included in util.cpp
* Cleanup code using forward declarations.Brandon Dahler2013-11-101-2/+4
| | | | | | | | | 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
|
* Replace printf with LogPrintf / LogPrintGavin Andresen2013-09-181-2/+2
|
* Introduce a CChainParameters singleton class and regtest mode.Mike Hearn2013-06-191-3/+3
| | | | | | | | | | | | | 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.
* Removed net.cpp's dependency on init.h.Eric Lombrozo2013-06-051-1/+0
| | | | | | | | | | Added explicit include of main.h in init.cpp, changed include of init.h to include of main.h in net.cpp. Added function registration for net.cpp in init.cpp's network initialization. Removed protocol.cpp's dependency on main.h. TODO: Remove main.h include in net.cpp.
* Always print full hashes (tx, block, inv)Pieter Wuille2013-04-071-6/+1
|
* Relay CMerkleBlocks when asked for MSG_FILTERED_BLOCKMatt Corallo2013-01-161-0/+1
|
* Abstract block hash substr extraction (for debug.log) into BlockHashStr inlineLuke Dashjr2012-11-131-0/+6
|
* 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.
* Add casts for unavoidable signed/unsigned comparisonsJeff Garzik2012-04-231-1/+1
| | | | | At these code sites, it is preferable to cast rather than change a variable's type.
* Fix loop index var types, fixing many minor sign comparison warningsJeff Garzik2012-04-151-1/+1
| | | | | foo.size() typically returns an unsigned integral type; make loop variables match those types' signedness.
* Update all copyrights to 2012Gavin Andresen2012-02-071-1/+1
|
* Network stack refactorPieter Wuille2012-01-061-167/+5
| | | | | | | | | | | | | | | This introduces CNetAddr and CService, respectively wrapping an (IPv6) IP address and an IP+port combination. This functionality used to be part of CAddress, which also contains network flags and connection attempt information. These extra fields are however not always necessary. These classes, along with logic for creating connections and doing name lookups, are moved to netbase.{h,cpp}, which does not depend on headers.h. Furthermore, CNetAddr is mostly IPv6-ready, though IPv6 functionality is not yet enabled for the application itself.
* Revert "Use standard C99 (and Qt) types for 64-bit integers"Wladimir J. van der Laan2011-12-211-8/+6
| | | | This reverts commit 21d9f36781604e4ca9fc35dc65265593423b73e9.
* Use standard C99 (and Qt) types for 64-bit integersLuke Dashjr2011-12-201-6/+8
|
* Use std::numeric_limits<> for typesafe INT_MAX/etcGavin Andresen2011-12-191-1/+1
|
* Fix build on windows and macGavin Andresen2011-10-071-1/+1
| | | | | | Replaced all occurrences of #if* __WXMSW__ with WIN32, and all occurrences of __WXMAC_OSX__ with MAC_OSX, and made sure those are defined appropriately in the makefile and bitcoin-qt.pro.
* Move CInv to protocol.[ch]ppGiel van Schijndel2011-08-191-0/+61
| | | | | | | This commit does *not* and should not modify *any* code, it only moves it from net.h and splits it across protocol.cpp and protocol.hpp. Signed-off-by: Giel van Schijndel <[email protected]>
* Move CAddress to protocol.[ch]ppGiel van Schijndel2011-08-191-0/+190
| | | | | | | This commit does *not* and should not modify *any* code, it only moves it from net.h and splits it across protocol.cpp and protocol.hpp. Signed-off-by: Giel van Schijndel <[email protected]>
* Start moving protocol-specific code to protocol.[ch]ppGiel van Schijndel2011-08-191-0/+61
Move CMessageHeader from net.h to protocol.[ch]pp, with the implementation in the .cpp compilation unit (compiling once is enough). This commit does *not* and should not modify *any* code, it only moves it from net.h and splits it across protocol.cpp and protocol.hpp. Indentation changes aside the closest thing to a modification of code is the addition of the 'TODO' comment (the execution of which requires code modifications and thus doesn't belong in this commit). Signed-off-by: Giel van Schijndel <[email protected]>