3 ms·
Dang it people. Race conditions. Security. I know it's not easy but it is important to get it right.
by ck2 13y ago
Dang it people. Race conditions. Security.
I know it's not easy but it is important to get it right.
- pistle 13y agoIt's not as hard as these hacks make it seem. Not checking for negative balance??? It doesn't get much more freshman CS than this.
- stcredzero 13y agoThis is exactly what Erlang would excel at implementing. Not that one couldn't do it wrong in that language as well. Same goes for Go and Clojure and a number of other languages with advanced concurrency features.
- curveship 13y agoSeriously. I thought this bit of code from the MtGox leak was interesting. Sure looks like a potential double-spend race condition: $out = \DB::DAO('Money_Bitcoin_Block_Tx_Out')->searchOne(array('Hash' => $bean->Hash, 'N' => $bean->N)); if ($out) { if ($out->Claimed == 'Y') { $bean->Available = 'N'; $bean->commit(); continue; } } What if someone else claims $out between the read and commit? Is no one at BTC exchanges really asking these kinds of questions?
- deleted 13y ago[deleted]