Bitcoin Forum
May 08, 2024, 08:39:12 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Inconsistencies with txindex=1. What's going on here?  (Read 1287 times)
shadouts (OP)
Newbie
*
Offline Offline

Activity: 5
Merit: 0


View Profile
November 21, 2016, 01:43:51 AM
 #1

Is there something wrong with the way bitcoin-qt handles txindex=1?

Current project: Raspnode full node

To assist with data creation, I synced the blockchain on a Debian machine.
To easily have visual feedback of its progress, I ran Bitcoin-Qt:
Code:
bitcoin-qt -txindex=1 -reindex -datadir=/media/<username>/<drivename>

I added "txindex=1" to ~/.config/Bitcoin/Bitcoin-Qt.conf

On this Debian machine, starting bitcoin-qt or bitcoin-qt -txindex=1 will start Bitcoin-Qt, but it acts as if txindex=0 since the RPC console cannot find spent transactions.

Starting bitcoind requests a reindex using command:
Code:
bitcoind -txindex=1 -datadir=/media/<username>/<drivename>

I moved the data drive to Raspbian, with a freshly compiled 0.13.1
Added "txindex=1" to ~/.config/Bitcoin/Bitcoin-Qt.conf
Running bitcoin-qt will start Bitcoin-Qt, but will not be able to find spent transactions in the RPC console
Running bitcoin-qt -txindex=1 will request a reindex (this is different from the Debian machine)
Running bitcoind requests a reindex

What's going on? It seems like Bitcoin-Qt might not be properly reindexing when given the command. Is anyone familiar with this quirk? I'm currently reindexing on the Debian machine using bitcoind to see if that helps.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715200752
Hero Member
*
Offline Offline

Posts: 1715200752

View Profile Personal Message (Offline)

Ignore
1715200752
Reply with quote  #2

1715200752
Report to moderator
1715200752
Hero Member
*
Offline Offline

Posts: 1715200752

View Profile Personal Message (Offline)

Ignore
1715200752
Reply with quote  #2

1715200752
Report to moderator
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3388
Merit: 6631


Just writing some code


View Profile WWW
November 21, 2016, 01:55:33 AM
 #2

I added "txindex=1" to ~/.config/Bitcoin/Bitcoin-Qt.conf
Added "txindex=1" to ~/.config/Bitcoin/Bitcoin-Qt.conf
That is your problem. That file is not the Bitcoin Core's config file. The config file is located in ~/.bitcoin/bitcoin.conf. It will not exist unless you create it; Bitcoin Core does not create it automatically.

shadouts (OP)
Newbie
*
Offline Offline

Activity: 5
Merit: 0


View Profile
November 21, 2016, 05:32:12 AM
 #3

I added "txindex=1" to ~/.config/Bitcoin/Bitcoin-Qt.conf
Added "txindex=1" to ~/.config/Bitcoin/Bitcoin-Qt.conf
That is your problem. That file is not the Bitcoin Core's config file. The config file is located in ~/.bitcoin/bitcoin.conf. It will not exist unless you create it; Bitcoin Core does not create it automatically.

~/.config/Bitcoin/Bitcoin-Qt.conf is what is created automatically in a Debian environment by bitcoin-qt. the file you reference is for bitcoind. I had made a file for bitcoind in that same location you suggest and tried it that way as well, but it didn't work. This config file should not matter since passing parameters in the command line is the same as adding them to the configuration file.
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3388
Merit: 6631


Just writing some code


View Profile WWW
November 21, 2016, 05:39:21 AM
 #4

I added "txindex=1" to ~/.config/Bitcoin/Bitcoin-Qt.conf
Added "txindex=1" to ~/.config/Bitcoin/Bitcoin-Qt.conf
That is your problem. That file is not the Bitcoin Core's config file. The config file is located in ~/.bitcoin/bitcoin.conf. It will not exist unless you create it; Bitcoin Core does not create it automatically.

~/.config/Bitcoin/Bitcoin-Qt.conf is what is created automatically in a Debian environment by bitcoin-qt. the file you reference is for bitcoind. I had made a file for bitcoind in that same location you suggest and tried it that way as well, but it didn't work. This config file should not matter since passing parameters in the command line is the same as adding them to the configuration file.
That file is a qt specific file done by the Qt framework behind the scenes. In windows it would add registry keys. The bitcoin.conf file is for both bitcoind and bitcoin-qt; they both do the same exact thing except that one has a gui and the other does not. The qt conf file is for qt specific options set by the gui, not the command line arguments that you are trying to use, that is for the bitcoin.conf file.

Use or make the bitcoin.conf file in ~/.bitcoin (or whatever you are using for your data directory). I guarantee you that it will work.

shadouts (OP)
Newbie
*
Offline Offline

Activity: 5
Merit: 0


View Profile
November 24, 2016, 04:51:23 PM
 #5

I added "txindex=1" to ~/.config/Bitcoin/Bitcoin-Qt.conf
Added "txindex=1" to ~/.config/Bitcoin/Bitcoin-Qt.conf
That is your problem. That file is not the Bitcoin Core's config file. The config file is located in ~/.bitcoin/bitcoin.conf. It will not exist unless you create it; Bitcoin Core does not create it automatically.

~/.config/Bitcoin/Bitcoin-Qt.conf is what is created automatically in a Debian environment by bitcoin-qt. the file you reference is for bitcoind. I had made a file for bitcoind in that same location you suggest and tried it that way as well, but it didn't work. This config file should not matter since passing parameters in the command line is the same as adding them to the configuration file.
That file is a qt specific file done by the Qt framework behind the scenes. In windows it would add registry keys. The bitcoin.conf file is for both bitcoind and bitcoin-qt; they both do the same exact thing except that one has a gui and the other does not. The qt conf file is for qt specific options set by the gui, not the command line arguments that you are trying to use, that is for the bitcoin.conf file.

Use or make the bitcoin.conf file in ~/.bitcoin (or whatever you are using for your data directory). I guarantee you that it will work.

I see that this is working now, but this still brings up an inconsistency in bitcoin-qt. If the Bitcoin-Qt.conf file has "txindex=1" added to it, the client will request a reindex, however, it will reindex as if txindex=0. It smells as if it is checking Bitcoin-Qt.conf for the option to load a full index, but when reindexing, since a bitcoin.conf file isn't created to specify txindex=1, it doesn't do a full index.
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3388
Merit: 6631


Just writing some code


View Profile WWW
November 24, 2016, 04:56:54 PM
 #6

I see that this is working now, but this still brings up an inconsistency in bitcoin-qt. If the Bitcoin-Qt.conf file has "txindex=1" added to it, the client will request a reindex, however, it will reindex as if txindex=0. It smells as if it is checking Bitcoin-Qt.conf for the option to load a full index, but when reindexing, since a bitcoin.conf file isn't created to specify txindex=1, it doesn't do a full index.
Again, as I said before, Bitcoin-Qt.conf is never checked by the client. It is only used by the Qt backend to handle QSettings stuff which is not related to your issue.

Double check the commands that you are using to start Bitcoin Core. My guess is that you have -reindex in your command and are conflating behavior from the CLI args and with this conf file which has nothing to do with Bitcoin Core's startup options.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!