Dang it people. Race conditions. Security.
I know it's not easy but it is important to get it right.
I know it's not easy but it is important to get it right.
$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?Not checking for negative balance??? It doesn't get much more freshman CS than this.