Bitcoin-ABC / Bitcoin-ABC/bitcoin-abc

listsinceblock reports wrong amount if tx has multiple vouts with same address

Open
#203 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C++
Stars
1.3k
Forks
788
PR merge metrics
No merged PRs in 30d

Description

### Describe the issue

TXID 459b264d38ad96295b91d8744d6f52079dbdad3b72f183bf58e3fe8fc52c47b5 has multiple vouts for the same address qqmlpuexkg42n2nfkpjt3ljn6fs9f3vk95ng0vpnhw

listsinceblock RPC and command both report only one of these vouts.

### Can you reliably reproduce the issue?
Yes.

#### If so, please list the steps to reproduce below:
You can check given txid by adding a watchonly address or generate another test transaction with multiple vouts having same address.

### Expected behaviour
I expect listsinceblock RPC and command to either show multiple records for multiple vouts or a single record with the sum of amounts.
```
{
"account": "",
"address": "bitcoincash:qqmlpuexkg42n2nfkpjt3ljn6fs9f3vk95ng0vpnhw",
"category": "receive",
"amount": 20.00000000,
"label": "",
"vout": 2,
"confirmations": 4358,
"blockhash": "0000000000000000003e3ab5fc73db0564dac91a850cda76ac1e84e23c17e6d9",
"blockindex": 5,
"blocktime": 1522763226,
"txid": "459b264d38ad96295b91d8744d6f52079dbdad3b72f183bf58e3fe8fc52c47b5",
"walletconflicts": [
],
"time": 1522763002,
"timereceived": 1522763002
},
{
"account": "",
"address": "bitcoincash:qqmlpuexkg42n2nfkpjt3ljn6fs9f3vk95ng0vpnhw",
"category": "receive",
"amount": 10.00000000,
"label": "",
"vout": 5,
"confirmations": 4358,
"blockhash": "0000000000000000003e3ab5fc73db0564dac91a850cda76ac1e84e23c17e6d9",
"blockindex": 5,
"blocktime": 1522763226,
"txid": "459b264d38ad96295b91d8744d6f52079dbdad3b72f183bf58e3fe8fc52c47b5",
"walletconflicts": [
],
"time": 1522763002,
"timereceived": 1522763002
}
```

### Actual behaviour
listsinceblock RPC and command both report only one of these vouts.

```
{
"account": "",
"address": "bitcoincash:qqmlpuexkg42n2nfkpjt3ljn6fs9f3vk95ng0vpnhw",
"category": "receive",
"amount": 20.00000000,
"label": "",
"vout": 2,
"confirmations": 4358,
"blockhash": "0000000000000000003e3ab5fc73db0564dac91a850cda76ac1e84e23c17e6d9",
"blockindex": 5,
"blocktime": 1522763226,
"txid": "459b264d38ad96295b91d8744d6f52079dbdad3b72f183bf58e3fe8fc52c47b5",
"walletconflicts": [
],
"time": 1522763002,
"timereceived": 1522763002
}
```

### What version of bitcoin-abc are you using?
Official Binary
"version": 170000,
"protocolversion": 70015,
"walletversion": 130000,

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.