<p>I'm currently working on accepting Bitcoins on my website. To do this I create a new address for every sale. I know I can get the amount of bitcoins that were paid into this address by using <code>./btcoind getreceivedbyaddress &lt;the-address&gt; 0</code> or <code>conn.getreceivedbyaddress(localAddress, 0)</code> when using the <a href="https://github.com/laanwj/bitcoin-python" rel="nofollow">python binding for bitcoin</a>. So far so good.</p>

<p>I now also want to get and display the amount of confirmations to the customer. So I made this:</p>

<pre><code>highestConfirmCount = None
for i in count():
    received = btcConn.getreceivedbyaddress(localAddress, i)
    if received &gt;= amountExpected:
        highestConfirmCount = i
    else:
        break
print highestConfirmCount
</code></pre>

<p>This works fine, but it's pretty slow for incoming payments which have been a while ago. Also, I would presume there would be a better and more efficient built in function for this, but I can't find anything like it.</p>

<p>Does anybody know what the best way is for getting confirmations for incoming payments to a specific address?</p>

<confirmations>
How to get confirmations for incoming transactions?
kramer65
# How to get confirmations for incoming transactions?

(Asked by: username_0 on 2014-03-23)

I'm currently working on accepting Bitcoins on my website. To do this I create a new address for every sale. I know I can get the amount of bitcoins that were paid into this address by using ./btcoind getreceivedbyaddress  0 or conn.getreceivedbyaddress(localAddress, 0) when using the python binding for bitcoin. So far so good.
I now also want to get and display the amount of confirmations to the customer. So I made this:
highestConfirmCount = None
for i in count():
    received = btcConn.getreceivedbyaddress(localAddress, i)
    if received >= amountExpected:
        highestConfirmCount = i
    else:
        break
print highestConfirmCount

This works fine, but it's pretty slow for incoming payments which have been a while ago. Also, I would presume there would be a better and more efficient built in function for this, but I can't find anything like it.
Does anybody know what the best way is for getting confirmations for incoming payments to a specific address?

**Tags:** confirmations


---

## 0 answers

