<p>some pseudo-code to work with the <a href="https://bitcoin.org/en/developer-reference#getrawtransaction" rel="nofollow noreferrer">Bitcoin-Core 0.16</a> (if there are simpler ways pls lmk).</p>

<p>suppose you all have is <code>height</code> and <code>addr</code></p>

<pre><code>hash = getblockhash(height)
block = getblock(hash)

for txid in block[‘txid’]:

  tx = getrawtransaction(txid)

  for vi in tx['vin']:
    original_tx = getrawtransaction(vi['txid'])
    for vo in original_tx['vout']:
      if vo['n'] == vi['vout'] and addr in vo['scriptPubKey']['addresses']:
        print('this tx is relevant')

  for vo in tx['vout']:
    if addr in vo['scriptPubKey']['addresses']:
      print('this tx is relevant')
</code></pre>

CC BY-SA 3.0
2018-04-19T06:32:31.850Z
2018-04-19T06:32:31.850Z
Will Gu
<p>Possible duplicate of <a href="https://bitcoin.stackexchange.com/questions/10090/how-to-get-an-addresss-balance-with-the-bitcoin-client">How to get an address&#39;s balance with the bitcoin client?</a> which has an excellent answer.</p>

<p>Sorry to post as an answer since rep is too low :)</p>

CC BY-SA 3.0
2018-02-07T21:28:51.350Z
2018-02-07T21:28:51.350Z
skang404
<p>If I have a block number and a bitcoin address -> Can I list all transactions for this address with an bitcoind command? Or mutliple commands?</p>

CC BY-SA 3.0
2018-02-07T20:48:48.327Z
Without using any programming language?
Tailer
<transactions><bitcoin-core><bitcoind><api><block>
Block number + bitcoin address -> Find transactions with bitcoind?
jan
# Block number + bitcoin address -> Find transactions with bitcoind?

(Asked by: username_0 on 2018-02-07)

If I have a block number and a bitcoin address -> Can I list all transactions for this address with an bitcoind command? Or mutliple commands?

**Tags:** transactions, bitcoin-core, bitcoind, api, block

> **Comments:**
> **username_1**: Without using any programming language?  

---

## 2 answers

### Answer by username_2 on 2018-04-19. Score: 1

some pseudo-code to work with the [Bitcoin-Core 0.16](https://bitcoin.org/en/developer-reference#getrawtransaction) (if there are simpler ways pls lmk).

suppose you all have is `height` and `addr`

```
hash = getblockhash(height)
block = getblock(hash)

for txid in block[‘txid’]:

  tx = getrawtransaction(txid)

  for vi in tx['vin']:
    original_tx = getrawtransaction(vi['txid'])
    for vo in original_tx['vout']:
      if vo['n'] == vi['vout'] and addr in vo['scriptPubKey']['addresses']:
        print('this tx is relevant')

  for vo in tx['vout']:
    if addr in vo['scriptPubKey']['addresses']:
      print('this tx is relevant')

```


---

### Answer by username_3 on 2018-02-07. Score: 0

Possible duplicate of [How to get an address's balance with the bitcoin client?](https://bitcoin.stackexchange.com/questions/10090/how-to-get-an-addresss-balance-with-the-bitcoin-client) which has an excellent answer.

Sorry to post as an answer since rep is too low :)


---

