aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
AgeCommit message (Collapse)Author
2016-10-19RPC: augment getblockchaininfo bip9_softforks datamruddy
2016-10-19Merge #8936: Report NodeId in misbehaving debugWladimir J. van der Laan
a1919ad Report NodeId in misbehaving debug (R E Broadley)
2016-10-18Merge #8865: Decouple peer-processing-logic from block-connection-logicWladimir J. van der Laan
a9aec5c Use BlockChecked signal to send reject messages from mapBlockSource (Matt Corallo) 7565e03 Remove SyncWithWallets wrapper function (Matt Corallo) 12ee1fe Always call UpdatedBlockTip, even if blocks were only disconnected (Matt Corallo) f5efa28 Remove CConnman parameter from ProcessNewBlock/ActivateBestChain (Matt Corallo) fef1010 Use CValidationInterface from chain logic to notify peer logic (Matt Corallo) aefcb7b Move net-processing logic definitions together in main.h (Matt Corallo) 0278fb5 Remove duplicate nBlocksEstimate cmp (we already checked IsIBD()) (Matt Corallo) 87e7d72 Make validationinterface.UpdatedBlockTip more verbose (Matt Corallo)
2016-10-18Merge #6996: Add preciousblock RPCWladimir J. van der Laan
5805ac8 Add preciousblock tests (Pieter Wuille) 5127c4f Add preciousblock RPC (Pieter Wuille)
2016-10-18Merge #8637: Compact Block Tweaks (rebase of #8235)Wladimir J. van der Laan
3ac6de0 Align constant names for maximum compact block / blocktxn depth (Pieter Wuille) b2e93a3 Add cmpctblock to debug help list (instagibbs) fe998e9 More agressively filter compact block requests (Matt Corallo) 02a337d Dont remove a "preferred" cmpctblock peer if they provide a block (Matt Corallo)
2016-10-18Merge #8914: Kill insecure_random and associated global stateWladimir J. van der Laan
5eaaa83 Kill insecure_random and associated global state (Wladimir J. van der Laan)
2016-10-18Report NodeId in misbehaving debugR E Broadley
2016-10-17Align constant names for maximum compact block / blocktxn depthPieter Wuille
2016-10-17More agressively filter compact block requestsMatt Corallo
Unit test adaptations by Pieter Wuille.
2016-10-17Dont remove a "preferred" cmpctblock peer if they provide a blockMatt Corallo
2016-10-17Merge #8499: Add several policy limits and disable uncompressed keys for ↵Wladimir J. van der Laan
segwit scripts 67d6ee1 remove redundant tests in p2p-segwit.py (Johnson Lau) 9260085 test segwit uncompressed key fixes (Johnson Lau) 248f3a7 Fix ismine and addwitnessaddress: no uncompressed keys in segwit (Pieter Wuille) b811124 [qa] Add tests for uncompressed pubkeys in segwit (Suhas Daftuar) 9f0397a Make test framework produce lowS signatures (Johnson Lau) 4c0c25a Require compressed keys in segwit as policy and disable signing with uncompressed keys for segwit scripts (Johnson Lau) 3ade2f6 Add standard limits for P2WSH with tests (Johnson Lau)
2016-10-17Kill insecure_random and associated global stateWladimir J. van der Laan
There are only a few uses of `insecure_random` outside the tests. This PR replaces uses of insecure_random (and its accompanying global state) in the core code with an FastRandomContext that is automatically seeded on creation. This is meant to be used for inner loops. The FastRandomContext can be in the outer scope, or the class itself, then rand32() is used inside the loop. Useful e.g. for pushing addresses in CNode or the fee rounding, or randomization for coin selection. As a context is created per purpose, thus it gets rid of cross-thread unprotected shared usage of a single set of globals, this should also get rid of the potential race conditions. - I'd say TxMempool::check is not called enough to warrant using a special fast random context, this is switched to GetRand() (open for discussion...) - The use of `insecure_rand` in ConnectThroughProxy has been replaced by an atomic integer counter. The only goal here is to have a different credentials pair for each connection to go on a different Tor circuit, it does not need to be random nor unpredictable. - To avoid having a FastRandomContext on every CNode, the context is passed into PushAddress as appropriate. There remains an insecure_random for test usage in `test_random.h`.
2016-10-16Add standard limits for P2WSH with testsJohnson Lau
2016-10-15Merge #8880: protocol.h: Move MESSAGE_START_SIZE into CMessageHeaderWladimir J. van der Laan
1df3111 protocol.h: Make enums in GetDataMsg concrete values (Wladimir J. van der Laan) 2c09a52 protocol.h: Move MESSAGE_START_SIZE into CMessageHeader (Wladimir J. van der Laan) f9bd92d version.h: s/shord/short/ in comment (Wladimir J. van der Laan)
2016-10-04Use BlockChecked signal to send reject messages from mapBlockSourceMatt Corallo
2016-10-04Remove SyncWithWallets wrapper functionMatt Corallo
2016-10-04Always call UpdatedBlockTip, even if blocks were only disconnectedMatt Corallo
2016-10-04Remove CConnman parameter from ProcessNewBlock/ActivateBestChainMatt Corallo
2016-10-04Use CValidationInterface from chain logic to notify peer logicMatt Corallo
This adds a new CValidationInterface subclass, defined in main.h, to receive notifications of UpdatedBlockTip and use that to push blocks to peers, instead of doing it directly from ActivateBestChain.
2016-10-04Use cmpctblock type 2 for segwit-enabled transferPieter Wuille
Contains version negotiation logic by Matt Corallo and bugfixes by Suhas Daftuar.
2016-10-04Remove duplicate nBlocksEstimate cmp (we already checked IsIBD())Matt Corallo
2016-10-04Make validationinterface.UpdatedBlockTip more verboseMatt Corallo
In anticipation of making all the callbacks out of block processing flow through it. Note that vHashes will always have something in it since pindexFork != pindexNewTip.
2016-10-04Make GetFetchFlags always request witness objects from witness peersMatt Corallo
This fixes a bug where we might (in exceedingly rare circumstances) accidentally ban a node for sending us the first (potentially few) segwit blocks in non-segwit mode.
2016-10-04protocol.h: Move MESSAGE_START_SIZE into CMessageHeaderWladimir J. van der Laan
Also move the enum to the top, and remove a deceptive TODO comment.
2016-10-01net: 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.
2016-09-28net: Consistent checksum handlingWladimir J. van der Laan
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.
2016-09-27Do not shadow variablesPavel Janík
2016-09-22Merge #8636: Implement NULLDUMMY softfork (BIP147)Wladimir J. van der Laan
482f852 Implement NULLDUMMY softfork (Johnson Lau)
2016-09-19Merge #8688: Move static global randomizer seeds into CConnmanWladimir J. van der Laan
d9ff591 Move static global randomizer seeds into CConnman (Pieter Wuille)
2016-09-19Move static global randomizer seeds into CConnmanPieter Wuille
2016-09-15UndoReadFromDisk works on undo files (rev), not on block files.Pavel Janík
2016-09-10fix op order to append first alertrodasmith
2016-09-09Merge #8681: Performance Regression Fix: Pre-Allocate txChanged vectorPieter Wuille
ec81881 Performance Regression Fix: Pre-Allocate txChanged vector (Jeremy Rubin)
2016-09-09Merge #8085: p2p: Begin encapsulationWladimir J. van der Laan
0103c5b net: move MAX_FEELER_CONNECTIONS into connman (Cory Fields) e700cd0 Convert ForEachNode* functions to take a templated function argument rather than a std::function to eliminate std::function overhead (Jeremy Rubin) d1a2295 Made the ForEachNode* functions in src/net.cpp more pragmatic and self documenting (Jeremy Rubin) 98591c5 net: move vNodesDisconnected into CConnman (Cory Fields) fa2f8bc net: add nSendBufferMaxSize/nReceiveFloodSize to CConnection::Options (Cory Fields) a19553b net: Introduce CConnection::Options to avoid passing so many params (Cory Fields) bafa5fc net: Drop StartNode/StopNode and use CConnman directly (Cory Fields) e81a602 net: pass CClientUIInterface into CConnman (Cory Fields) f60b905 net: Pass best block known height into CConnman (Cory Fields) fdf69ff net: move max/max-outbound to CConnman (Cory Fields) 8a59369 net: move semOutbound to CConnman (Cory Fields) bd72937 net: move nLocalServices/nRelevantServices to CConnman (Cory Fields) be9c796 net: move SendBufferSize/ReceiveFloodSize to CConnman (Cory Fields) 63cafa6 net: move send/recv statistics to CConnman (Cory Fields) adf5d4c net: SocketSendData returns written size (Cory Fields) ee44fa9 net: move messageHandlerCondition to CConnman (Cory Fields) 960cf2e net: move nLocalHostNonce to CConnman (Cory Fields) 551e088 net: move nLastNodeId to CConnman (Cory Fields) 6c19d92 net: move whitelist functions into CConnman (Cory Fields) 53347f0 net: create generic functor accessors and move vNodes to CConnman (Cory Fields) c0569c7 net: Add most functions needed for vNodes to CConnman (Cory Fields) 8ae2dac net: move added node functions to CConnman (Cory Fields) 502dd3a net: Add oneshot functions to CConnman (Cory Fields) a0f3d3c net: move ban and addrman functions into CConnman (Cory Fields) aaf018e net: handle nodesignals in CConnman (Cory Fields) b1a5f43 net: move OpenNetworkConnection into CConnman (Cory Fields) 02137f1 net: Move socket binding into CConnman (Cory Fields) 5b446dd net: Pass CConnection to wallet rather than using the global (Cory Fields) 8d58c4d net: Pass CConnman around as needed (Cory Fields) d7349ca net: Add rpc error for missing/disabled p2p functionality (Cory Fields) cd16f48 net: Create CConnman to encapsulate p2p connections (Cory Fields) d93b14d net: move CBanDB and CAddrDB out of net.h/cpp (Cory Fields) 531214f gui: add NodeID to the peer table (Cory Fields)
2016-09-09Merge #8677: Do not shadow upper local variable 'send', prevent -Wshadow ↵Wladimir J. van der Laan
compiler warning. 125b946 Do not shadow upper local variable 'send', prevent -Wshadow compiler warning. (Pavel Janík)
2016-09-09Merge #8525: Do not store witness txn in rejection cacheWladimir J. van der Laan
ca10a03 Add basic test for IsStandard witness transaction blinding (instagibbs) 34521e4 Do not store witness txn in rejection cache (Pieter Wuille)
2016-09-08Made the ForEachNode* functions in src/net.cpp more pragmatic and self ↵Jeremy Rubin
documenting
2016-09-08net: Pass best block known height into CConnmanCory Fields
CConnman then passes the current best height into CNode at creation time. This way CConnman/CNode have no dependency on main for height, and the signals only move in one direction. This also helps to prevent identity leakage a tiny bit. Before this change, an attacker could theoretically make 2 connections on different interfaces. They would connect fully on one, and only establish the initial connection on the other. Once they receive a new block, they would relay it to your first connection, and immediately commence the version handshake on the second. Since the new block height is reflected immediately, they could attempt to learn whether the two connections were correlated. This is, of course, incredibly unlikely to work due to the small timings involved and receipt from other senders. But it doesn't hurt to lock-in nBestHeight at the time of connection, rather than letting the remote choose the time.
2016-09-08net: move nLocalServices/nRelevantServices to CConnmanCory Fields
These are in-turn passed to CNode at connection time. This allows us to offer different services to different peers (or test the effects of doing so).
2016-09-08net: move SendBufferSize/ReceiveFloodSize to CConnmanCory Fields
2016-09-08net: move send/recv statistics to CConnmanCory Fields
2016-09-08net: move nLocalHostNonce to CConnmanCory Fields
This behavior seems to have been quite racy and broken. Move nLocalHostNonce into CNode, and check received nonces against all non-fully-connected nodes. If there's a match, assume we've connected to ourself.
2016-09-08net: create generic functor accessors and move vNodes to CConnmanCory Fields
2016-09-08net: move ban and addrman functions into CConnmanCory Fields
2016-09-08net: handle nodesignals in CConnmanCory Fields
2016-09-08net: Pass CConnection to wallet rather than using the globalCory Fields
2016-09-08net: Pass CConnman around as neededCory Fields
2016-09-07Performance Regression Fix: Pre-Allocate txChanged vectorJeremy Rubin
2016-09-07Do not shadow upper local variable 'send', prevent -Wshadow compiler warning.Pavel Janík
2016-09-07Merge #8594: Do not add random inbound peers to addrman.Pieter Wuille
eb3596f Do not add random inbound peers to addrman. (Gregory Maxwell)