forex.pm forex forum binary options trade

 Сryptocurrency exchanges => Binance - Сryptocurrency exchanges => Topic started by: Bitcoin on Feb 13, 2022, 11:11 am

Title: BTC - Block Index - Reading the flag values in Level DB
Post by: Bitcoin on Feb 13, 2022, 11:11 am
BTC - Block Index - Reading the flag values in Level DB

Following the article I tried reading the flag value for txindex in the Block Index database but was not able to fetch the values. I tried fetching value for all below but its NULL always. Am I doing something wrong?


    private readonly byte[] TRANSACTIONINDEX_ENABLED = new byte[] { 70, 8, 116, 120, 105, 110, 100, 101, 120, 1 }; // F8txindex
    private readonly byte[] TRANSACTIONINDEX_ENABLED1 = new byte[] { 70, 7, 116, 120, 105, 110, 100, 101, 120, 1 }; // F7txindex
    private readonly byte[] TRANSACTIONINDEX_ENABLED2 = new byte[] { 70, 7, 1, 120, 101, 100, 110, 105, 120, 116 }; // F7txindex little endian
    private readonly byte[] TRANSACTIONINDEX_ENABLED21 = new byte[] { 70, 7, 120, 101, 100, 110, 105, 120, 116, 1 }; // F7txindex little endian
    private readonly byte[] TRANSACTIONINDEX_ENABLED3 = new byte[] { 70, 8, 116, 120, 105, 110, 100, 101, 120, 1 }; // F8txindex little endian
    private readonly byte[] TRANSACTIONINDEX_ENABLED31 = new byte[] { 70, 8, 120, 101, 100, 110, 105, 120, 116, 1 }; // F8txindex little endian
    private readonly byte[] TRANSACTIONINDEX_DISABLED = new byte[] { 70, 8, 116, 120, 105, 110, 100, 101, 120, 0 }; // F8txindex
    private readonly byte[] TRANSACTIONINDEX_DISABLED1 = new byte[] { 70, 7, 116, 120, 105, 110, 100, 101, 120, 0 }; // F7txindex
    private readonly byte[] TRANSACTIONINDEX_DISABLED2 = new byte[] { 70, 7, 0, 120, 101, 100, 110, 105, 120, 116 }; // F7txindex little endian
    private readonly byte[] TRANSACTIONINDEX_DISABLED21 = new byte[] { 70, 7, 120, 101, 100, 110, 105, 120, 116, 0 }; // F7txindex little endian
    private readonly byte[] TRANSACTIONINDEX_DISABLED3 = new byte[] { 70, 8, 116, 120, 105, 110, 100, 101, 120, 0 }; // F8txindex little endian
    private readonly byte[] TRANSACTIONINDEX_DISABLED31 = new byte[] { 70, 8, 120, 101, 100, 110, 105, 120, 116, 0 }; // F8txindex little endian

Additionally, how to fetch the mapping between data fetched from block index and the bat file where details of the block are. I assumed that Block Index record will have details of the file (blk000????.dat) where to look for the block but it doesnt have anything


Source: BTC - Block Index - Reading the flag values in Level DB (https://bitcoin.stackexchange.com/questions/106380/btc-block-index-reading-the-flag-values-in-level-db)