Title: Question about bitcoin confirmations Post by: NonProphet on July 21, 2011, 07:47:07 PM Hey everyone, I've got another (hopefully last) question about bitcoin.
I'm working on a web app that has deposit/withdraw functionality with bitcoin. I got deposits going through and everything looks to be going smoothly. But I noticed a bug and I'm not sure why it is happening. Every user has their own account that they deposit to, and I have a cron script that runs every 5 minutes to check pending deposits. I use getReceivedByAccount('user account name', 5) to make sure that there are 5 confirmations. After 1 confirmation (first pass of the cron script), the deposit went through. I'm thinking it has something to do with the fact that this is the second deposit in a row for the same amount to/from the same addresses. The API call returns the amount received and I compare that to the pending deposit amount to see if it is a match. Any thoughts on why it went through after 1 confirmation like that? Title: Re: Question about bitcoin confirmations Post by: NonProphet on July 22, 2011, 06:11:57 PM Bump...
I'm still stumped on this. Does getReceivedByAccount store the total currently in the address or the total received? If I deposit 2 deposits of 0.5 BTC, but I move the .5 BTC to another wallet after it goes through, should it return 0.5BTC or 1 BTC, after the first one goes through but waiting on the second deposit. Any thoughts? |