Recording Transaction Advertisements
Bitcoin clients keep track of the order of the received transaction advertisements. If a request for a given transaction is not delivered, the next peer in the list is queried.
When a transaction T is advertised via an inv message to a given node, the latter keeps track of the order of announcements with a first-in first-out (FIFO) buffer. Each time a peer advertises T, the peer is inserted into the buffer. Transaction T is only requested from one peer at a time. For each entry in the buffer, Bitcoin clients maintain a 2-minute time-out, after which the next entry in the buffer is queried for T.
Internal Reputation Management System
Bitcoin combats the broadcasting of ill-formed blocks and transactions by maintaining an internal reputation management system. Namely, whenever a node receives objects (e.g., blocks, transactions), it checks their correctness before forwarding them to other peers in the network. First, objects are validated based on their respective syntax and size (e.g., oversized objects are discarded). If this verification passes, the contents of the objects are subsequently validated. For transactions, this includes verifying the signature and the input and output coins used in the transaction; similarly, the PoW included in block headers is verified with respect to the current network difficulty.
To prevent any abuse of the Bitcoin overlay network (e.g., denial-of-service attacks), a receiving node locally assigns a penalty to peers who broadcast ill- formed objects. Once a node has reached 100 penalty points, the receiving node disconnects from the misbehaving node for 24 hours. For example, if a node broadcasts invalid alerts, then it will be given 10 penalty points. Nodes that attempt more serious misbehavior, such as inserting invalid transaction signatures, are immediately assigned 100 points, and therefore directly banned. Penalties also apply to ill-formed control messages such as inv (inventory) or addr commands. Note that locally assigned penalties are not transmitted to other peers.