bitpay / bitcoin

Bitcore Bitcoin build with address indexes
https://bitcore.io/bitcoin
MIT License
61 stars 40 forks source link

The index of address balances does not work well #48

Open ander7agar opened 6 years ago

ander7agar commented 6 years ago

I have been testing version 0.12.1, and I have seen that the address balance index does not work correctly. It seems to be missing some transactions to be indexed. For example, the balance of the address 12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX according to blockchain.info should be 50.0587895 BTC, but the core returns only 0.0587895 BTC, 50 BTC is missing.

my@explorer:~# bitcoin-cli getaddressbalance '{"addresses": ["12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX"]}'
{
  "balance": 5878950,
  "received": 5878950
}

The first time this happened I turned off the core and re-executed it with reindex = 1, but when I finished I saw the balance of the same address again and returned the same. I have bought other addresses such as 1HLoD9E4SDFFPDiYfNYnkBLQ85Y51J3Zb1 and 50 BTCs too.

my@explorer:~# bitcoin-cli getaddressbalance '{"addresses": ["1HLoD9E4SDFFPDiYfNYnkBLQ85Y51J3Zb1"]}'
{
  "balance": 998292,
  "received": 998292
}

Interestingly, the amount that is missing is the same amount as the first transaction they received (Coinbase)

uFire commented 6 years ago

I confirm. Tons of wrong balances. Running two full nodes and both of them has same problems with incorrect balances.

UPD: As I can see, there is a problem with counting newly generated coins.