6

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.

1 Answers1

13

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
  • 98,249
  • 9
  • 183
  • 287
  • 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 May 19 '17 at 00:51
  • 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 wallets – Thamer Mazzuca Martins May 19 '17 at 00:53
  • I update question, you can help ? – Thamer Mazzuca Martins May 19 '17 at 01:05
  • gettransaction/getreceivedbyaddress/... are wallet RPCs. They only work for transactions that affect your own wallet. – Pieter Wuille May 19 '17 at 01:10
  • 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 May 19 '17 at 01:15
  • 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 May 19 '17 at 01:20
  • 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 May 19 '17 at 01:22
  • 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 May 19 '17 at 01:24
  • 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 transaction – Thamer Mazzuca Martins May 19 '17 at 01:38
  • 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 May 19 '17 at 01:48
  • Used dbcache=8192 - out of memory at around 500k block. Use 24 GB. Make swapfile if no RAM. – pbies Aug 26 '23 at 01:50