Bitcoind, change to txindex=1

5

2

I have a fullnode without txindex. Some transactions of mine related to my wallet are not being found by fullnode, only in blockchain.info. My HD is around 130GB, and it's fully synced to the last block. I would like to know, if using txindex = 1, will solve my problem with transactions that are not found. Using txindex = 1 and -reindex, how long does it take to finish? Fullnode will have to download again the 130GB? Will increase storage?

For exemple: https://blockchain.info/pt/tx/1585045cf36e18829292eef72281c8a0a748488d960816437dbd0797d896adf9 This transaction send for 1BS3caAYJH5LTKprkbvhkSLVUhpa9QsvMp my wallet.

When i run bitcoin-cli getreceivedbyaddress 1BS3caAYJH5LTKprkbvhkSLVUhpa9QsvMp 0, result is 0.00000000 When i run bitcoin-cli gettransaction 1585045cf36e18829292eef72281c8a0a748488d960816437dbd0797d896adf9, resulti is error code: -5 error message: Invalid or non-wallet transaction id How i solve it ?

Thank you.

Thamer Mazzuca Martins

Posted 2017-05-19T00:24:05.270

Reputation: 85

Answers

7

I would like to know, if using txindex = 1, will solve my problem with transactions that are not found.

Yes, getrawtransaction only works for transactions with unspent outputs, unless txindex is enabled (in which case it will find every transaction). gettransaction only works for your wallet transactions.

Using txindex = 1 and -reindex, how long does it take to finish?

It depends on your hardware, but it can be between hours and days on low-end hardware. Using a larger -dbcache will massively speed it up.

Fullnode will have to download again the 130GB?

No. It just reprocesses blocks you already have on disk.

Will increase storage?

Yes, a few gigabytes.

OBS: My real problem is that there are some transactions that have been made to my wallet and my fullnode can not find it.

Your wallet has nothing to do with getrawtransaction. You can always use gettransaction for your own transactions, though.

Pieter Wuille

Posted 2017-05-19T00:24:05.270

Reputation: 54 032

Thank you for response, i have more one question, if i change for txindex and run with -reindex and -dbcache, i need run with -daemon ? And i can send and receive bitcoin in process ?Thamer Mazzuca Martins 2017-05-19T00:51:42.510

When you say You can always use gettransaction for your own transactions, though.. it is i send bitcoin ? or receive bitcoin in my wallet? Because i receive notify in php file for ervery transaction of my wallet. Exists some trasaction for my wallet i not receive and my fullnode not found. I not want get info for other transactions of other walletsThamer Mazzuca Martins 2017-05-19T00:53:41.027

I update question, you can help ?Thamer Mazzuca Martins 2017-05-19T01:05:25.430

gettransaction/getreceivedbyaddress/... are wallet RPCs. They only work for transactions that affect your own wallet.Pieter Wuille 2017-05-19T01:10:23.873

Yes Pieter, in exemple i say, wallet of transaction receive payment is mine, and my fullnode not found, i rescan and it not fix,.Thamer Mazzuca Martins 2017-05-19T01:15:12.527

By 'your own wallet' I mean the wallet built into your full node. You can use importaddress to make that wallet consider certain addresses to be its own.Pieter Wuille 2017-05-19T01:20:50.910

Why does this happen with just a few wallets? I generate several wallets and only with a few, fullnode does not find the transaction.Thamer Mazzuca Martins 2017-05-19T01:22:37.843

I explained. getrawtransaction works always for transactions with unspent outputs. If you want it to work for transactions with spent outputs, you need txindex.Pieter Wuille 2017-05-19T01:24:49.977

Why when i use getreceivedbyaddress 0 for this wallet, have a transaction with 0 confirmations and it result 0.00000000 if it is my own wallet and in blockchain say have a transactionThamer Mazzuca Martins 2017-05-19T01:38:56.490

Please read what I say. getreceivedbyaddress only EVER works for your own wallet. It does not work for arbitrary addresses. It won't even work with txindex.Pieter Wuille 2017-05-19T01:48:44.797