bitcoinjs/bitcoinjs-server — Issue #62: Avoid re-requesting blocks/txs after invs
Author: justmoon
Created: 2012-02-07 08:03:48+00:00
State: open

Currently, BitcoinJS will not synchronize between different inv requests from multiple peers. This means that if several invs arrive in short succession, before the first getdata has been answered, it may request the same item multiple times, e.g.

```
4 Feb 18:42:38 - bchdbg: Block added successfully
4 Feb 18:42:38 - bchdbg: Connecting block 0000000000000babdbc5 (parent 38dea57e08 known)
4 Feb 18:42:38 - bchdbg: Connecting block 0000000000000babdbc5 (parent 38dea57e08 known)
4 Feb 18:42:38 - bchdbg: Connecting block 0000000000000babdbc5 (parent 38dea57e08 known)
4 Feb 18:42:38 - bchdbg: Connecting block 0000000000000babdbc5 (parent 38dea57e08 known)
4 Feb 18:42:38 - bchdbg: Connecting block 0000000000000babdbc5 (parent 38dea57e08 known)
4 Feb 18:42:38 - bchdbg: Connecting block 0000000000000babdbc5 (parent 38dea57e08 known)
4 Feb 18:42:38 - bchdbg: Connecting block 0000000000000babdbc5 (parent 38dea57e08 known)
4 Feb 18:42:38 - bchdbg: Connecting block 0000000000000babdbc5 (parent 38dea57e08 known)
4 Feb 18:42:38 - info: Downloading blocks 140320/165368 (top: 4db2f219cd, peer: 94.171.160.238:8333)
```

This is theoretically more secure than the original client (which has a 2 minute timeout during which no second attempt to request a specific block is made), but obviously untenable as the number of connections and the size of blocks goes up. So a suitable security/performance trade-off has to be found.