Because getblocktxn requests for unknown blocks would trigger a disconnect, while a getblocktxn for known-old blocks would just be ignored, it should be possible to fingerprint a node by seeing which old, non-main-chain blocks trigger disconnect.
The first commit removes the misbehaving score to eliminate this distinction.
In the handling of CMPCTBLOCK messages, the handling for blocks that are announced that have too little work, or where the block was known but pruned, was busted – for requested blocks, we would generate a getdata for the block, but for unrequested blocks, we’d fall through and try to process. In particular, this means that announcing old CMPCTBLOCKs could cause a pruning node to redownload old blocks (potentially causing a fill-up-disk DoS).
The second commit fixes this by aborting processing of CMPCTBLOCK messages in this situation.
Please tag this for consideration in 0.13.0.