Bitcoin Forum
January 22, 2017, 04:24:31 PM *
News: Latest stable version of Bitcoin Core: 0.13.2  [Torrent]. (New!)
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Question about bitcoin confirmations  (Read 598 times)
NonProphet
Newbie
*
Offline Offline

Activity: 15


View Profile
July 21, 2011, 07:47:07 PM
 #1

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?
1485102271
Hero Member
*
Offline Offline

Posts: 1485102271

View Profile Personal Message (Offline)

Ignore
1485102271
Reply with quote  #2

1485102271
Report to moderator
There are several different types of Bitcoin clients. The most secure are full nodes like Bitcoin-Qt, which will follow the rules of the network no matter what miners do. Even if every miner decided to create 1000 bitcoins per block, full nodes would stick to the rules and reject those blocks.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1485102271
Hero Member
*
Offline Offline

Posts: 1485102271

View Profile Personal Message (Offline)

Ignore
1485102271
Reply with quote  #2

1485102271
Report to moderator
1485102271
Hero Member
*
Offline Offline

Posts: 1485102271

View Profile Personal Message (Offline)

Ignore
1485102271
Reply with quote  #2

1485102271
Report to moderator
NonProphet
Newbie
*
Offline Offline

Activity: 15


View Profile
July 22, 2011, 06:11:57 PM
 #2

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?
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!