namecoin / namecoin-legacy

Legacy client. New version here: https://github.com/namecoin/namecoin-core Note the release branch! - Official website:
https://namecoin.org
MIT License
448 stars 177 forks source link

Check earlier for blocks with duplicate transactions to prevent DoS. #110

Closed phelixbtc closed 10 years ago

phelixbtc commented 10 years ago

Port from Bitcoin be8651dde7b59e50e8c443da71c706667803d06d

domob1812 commented 10 years ago

ACK. I personally would have formulated the code differently, though. (Using std::set::count or std::set::find at each step to check whether the thing to insert is already in there, instead of comparing the size at the end.) I think it doesn't really make any difference, though, neither in performance nor functionality.

phelixbtc commented 10 years ago

Well, so far I'm only really comfortable with copy/paste from Bitcoin because this code is well tested. :)