txtnindex=1 but balances still zero?

0

I'm running a full node (v0.16.0). I added txnindex=1 to my configuration file and restarted the Bitcoin-Qt. It took 2+ days to build the index but when I check addresses with known final balances>0 the amount is still zero. For example...

REMOTE FINAL BALANCE=66.76870249 BTC:

https://blockchain.info/address/1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa

LOCAL FINAL BALANCE=0:

let address='1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa';
client.getBalance(address, 6, function(error, balance, resHeaders) {
log('Address: ' + address + ' Balance:'  + balance);
});

Any ideas would be appreciated!

Corbin

Posted 2018-03-08T18:28:31.840

Reputation: 115

Answers

0

RPC getBalance only works with addresses valid in the local wallet. Once txindex is enabled, RPC getrawtransaction will return transaction data for any address on the blockchain.

Calculating the balance for an arbitrary address is possible because almost every blockchain explorer does it. However, calculating a balance for an address using RPC getrawtransaction is not possible.

Corbin

Posted 2018-03-08T18:28:31.840

Reputation: 115

0

Yes, as you said it just for local wallet, if you want to get address balance you should importaddress and rescan the blockchain then you can check that address transactions and balance.

or you can integrate bitcoin-core with electrumx so you be able to get any address balance or even a transaction.

Adam

Posted 2018-03-08T18:28:31.840

Reputation: 3 215