Bitcoin Forum
May 21, 2024, 10:12:17 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: can't find some transaction in my bitcoind  (Read 1009 times)
bit_kevin (OP)
Member
**
Offline Offline

Activity: 64
Merit: 10


btc.com


View Profile WWW
May 23, 2013, 09:31:55 AM
 #1

tx id: 85966ed46764440edf4fa73ee95c628d5a92b45824ae957a04aa889803df0fc9

can't find it in my bitcoind:

$ bitcoind getrawtransaction 85966ed46764440edf4fa73ee95c628d5a92b45824ae957a04aa889803df0fc9 1
error: {"code":-5,"message":"No information available about transaction"}

It is exist on blockchain: https://blockchain.info/tx/85966ed46764440edf4fa73ee95c628d5a92b45824ae957a04aa889803df0fc9

This tx's input address is: 1dice8EMZmqKvrGE4Qc9bUFf9PX3xaYDp (SatoshiDICE 48%), is this the reason why it is not in my bitcoind?
DannyHamilton
Legendary
*
Offline Offline

Activity: 3388
Merit: 4653



View Profile
May 26, 2013, 01:46:11 AM
 #2

tx id: 85966ed46764440edf4fa73ee95c628d5a92b45824ae957a04aa889803df0fc9

can't find it in my bitcoind:

$ bitcoind getrawtransaction 85966ed46764440edf4fa73ee95c628d5a92b45824ae957a04aa889803df0fc9 1
error: {"code":-5,"message":"No information available about transaction"}

It is exist on blockchain: https://blockchain.info/tx/85966ed46764440edf4fa73ee95c628d5a92b45824ae957a04aa889803df0fc9

This tx's input address is: 1dice8EMZmqKvrGE4Qc9bUFf9PX3xaYDp (SatoshiDICE 48%), is this the reason why it is not in my bitcoind?

Are either of the output addresses part of your wallet?
bit_kevin (OP)
Member
**
Offline Offline

Activity: 64
Merit: 10


btc.com


View Profile WWW
May 26, 2013, 05:20:06 AM
 #3

tx id: 85966ed46764440edf4fa73ee95c628d5a92b45824ae957a04aa889803df0fc9

can't find it in my bitcoind:

$ bitcoind getrawtransaction 85966ed46764440edf4fa73ee95c628d5a92b45824ae957a04aa889803df0fc9 1
error: {"code":-5,"message":"No information available about transaction"}

It is exist on blockchain: https://blockchain.info/tx/85966ed46764440edf4fa73ee95c628d5a92b45824ae957a04aa889803df0fc9

This tx's input address is: 1dice8EMZmqKvrGE4Qc9bUFf9PX3xaYDp (SatoshiDICE 48%), is this the reason why it is not in my bitcoind?

Are either of the output addresses part of your wallet?
Nope. I used cmd "bitcoind getrawtransaction" and got some txs that not belong to my wallet.

Is there any filters in bitcoind that fileter out transactions which came from SatoshiDICE's address?
CIYAM
Legendary
*
Offline Offline

Activity: 1890
Merit: 1078


Ian Knowles - CIYAM Lead Developer


View Profile WWW
May 26, 2013, 05:34:40 AM
 #4

Nope. I used cmd "bitcoind getrawtransaction" and got some txs that not belong to my wallet.

Is there any filters in bitcoind that fileter out transactions which came from SatoshiDICE's address?

Nope but by default "getrawtransaction" will not allow you to access tx's that do not involve your own addresses (http://bitcoin.stackexchange.com/questions/9147/getrawtransaction-error-code-5 for details and how to fix this).

With CIYAM anyone can create 100% generated C++ web applications in literally minutes.

GPG Public Key | 1ciyam3htJit1feGa26p2wQ4aw6KFTejU
Pieter Wuille
Legendary
*
qt
Offline Offline

Activity: 1072
Merit: 1174


View Profile WWW
May 26, 2013, 06:16:40 AM
 #5

Nope but by default "getrawtransaction" will not allow you to access tx's that do not involve your own addresses (http://bitcoin.stackexchange.com/questions/9147/getrawtransaction-error-code-5 for details and how to fix this).

Getrawtransaction queries the blockchain, not your wallet. Whether the transaction is in your wallet is irrelevant; without txindex=1, it only works for unspent transactions (slowly). With txindex=1, it will work for any transaction.

I do Bitcoin stuff.
CIYAM
Legendary
*
Offline Offline

Activity: 1890
Merit: 1078


Ian Knowles - CIYAM Lead Developer


View Profile WWW
May 26, 2013, 06:21:43 AM
 #6

Nope but by default "getrawtransaction" will not allow you to access tx's that do not involve your own addresses (http://bitcoin.stackexchange.com/questions/9147/getrawtransaction-error-code-5 for details and how to fix this).

Getrawtransaction queries the blockchain, not your wallet. Whether the transaction is in your wallet is irrelevant; without txindex=1, it only works for unspent transactions (slowly). With txindex=1, it will work for any transaction.

Oh - thanks for that clarification (funnily enough I gave the link to the correct information that was in fact your answer but read it wrong) - so presumably with txindex=1 it will work quickly for any transaction?

With CIYAM anyone can create 100% generated C++ web applications in literally minutes.

GPG Public Key | 1ciyam3htJit1feGa26p2wQ4aw6KFTejU
bit_kevin (OP)
Member
**
Offline Offline

Activity: 64
Merit: 10


btc.com


View Profile WWW
May 28, 2013, 06:57:29 AM
 #7

Nope but by default "getrawtransaction" will not allow you to access tx's that do not involve your own addresses (http://bitcoin.stackexchange.com/questions/9147/getrawtransaction-error-code-5 for details and how to fix this).

Getrawtransaction queries the blockchain, not your wallet. Whether the transaction is in your wallet is irrelevant; without txindex=1, it only works for unspent transactions (slowly). With txindex=1, it will work for any transaction.

I have run bitcoind -txindex=1 -reindex=1 first, than bitcoind -txindex=1 --daemon. But still can't find this transaction:

$ bitcoind getrawtransaction 4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b 1
error: {"code":-5,"message":"No information available about transaction"}

This transactino is in block 0. See: http://blockexplorer.com/tx/4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b.

Should I remove all data and start with a empty bitcoind to get all transaction?
CIYAM
Legendary
*
Offline Offline

Activity: 1890
Merit: 1078


Ian Knowles - CIYAM Lead Developer


View Profile WWW
May 28, 2013, 07:01:49 AM
 #8


I do recall reading somewhere that there is perhaps a bug that prevents this particular tx (i.e. in block 0) from being seen via "getrawtransaction" - perhaps Pieter would know more about this.

At the same time I would be curious to know if "-blocknotify=cmd" would work (is that how blockexplorer got its information?).

In any case that 50 BTC *cannot* be spent (so no need to worry about this tx as being an UTXO).

With CIYAM anyone can create 100% generated C++ web applications in literally minutes.

GPG Public Key | 1ciyam3htJit1feGa26p2wQ4aw6KFTejU
bit_kevin (OP)
Member
**
Offline Offline

Activity: 64
Merit: 10


btc.com


View Profile WWW
May 28, 2013, 09:49:05 AM
 #9


I do recall reading somewhere that there is perhaps a bug that prevents this particular tx (i.e. in block 0) from being seen via "getrawtransaction" - perhaps Pieter would know more about this.

At the same time I would be curious to know if "-blocknotify=cmd" would work (is that how blockexplorer got its information?).

In any case that 50 BTC *cannot* be spent (so no need to worry about this tx as being an UTXO).


can't find raw tx:
1. pblocktree->ReadTxIndex(hash, postx) read failure, tx is NOT in pblocktree.
2. view.GetCoins(hash, coins) get failure too, this tx's coin is not in CCoinsViewCache.

because this tx is in block 0, so I modify source code as below:

--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1002,7 +1002,7 @@ bool GetTransaction(const uint256 &hash, CTransaction &txOut, uint256 &hashBlock
                 if (view.GetCoins(hash, coins))
                     nHeight = coins.nHeight;
             }
-            if (nHeight > 0)
+            if (nHeight >= 0)
                 pindexSlow = FindBlockByHeight(nHeight);
         }
     }

rebuild it and run, still not work.

Write tx index code is in function CBlock::ConnectBlock:

bool CBlock::ConnectBlock(CValidationState &state, CBlockIndex* pindex, CCoinsViewCache &view, bool fJustCheck) {
...
    if (fTxIndex)
        if (!pblocktree->WriteTxIndex(vPos))
            return state.Abort(_("Failed to write transaction index"));
...
}

maybe forget to ConnectBlock 'GenesisBlock', so I try bitcoind -loadblock="~/Library/Application\ Support/Bitcoin/blocks/blk00000.dat", and it works:

$ bitcoind getrawtransaction 4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b 1
{
    "hex" : "01000000010000000000000000000000000000000000000000000000000000000000000000fffff fff4d04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c 6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b7 3ffffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909 a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11 d5fac00000000",
    "txid" : "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
    "version" : 1,
    "locktime" : 0,
    "vin" : [
        {
            "coinbase" : "04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f7 2206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73",
            "sequence" : 4294967295
        }
    ],
    "vout" : [
        {
            "value" : 50.00000000,
            "n" : 0,
            "scriptPubKey" : {
                "asm" : "04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef3 8c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f OP_CHECKSIG",
                "hex" : "4104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4ce f38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac",
                "reqSigs" : 1,
                "type" : "pubkey",
                "addresses" : [
                    "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa"
                ]
            }
        }
    ],
    "blockhash" : "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",
    "confirmations" : 238323,
    "time" : 1231006505,
    "blocktime" : 1231006505
}


but after I restart bitcoind, it does not work anymore.
cr1776
Legendary
*
Offline Offline

Activity: 4046
Merit: 1301


View Profile
May 28, 2013, 04:17:45 PM
 #10

If I understand your question correctly, my understanding is that the reference client does not include block 0 in its database (e.g. the list of known transactions etc) at startup because it is structured differently than the other blocks since it is not a "normal" block.  This could be why you can not get information on that transaction with bitcoind.   Smiley




This transactino is in block 0. See: http://blockexplorer.com/tx/4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b.

Should I remove all data and start with a empty bitcoind to get all transaction?
kjj
Legendary
*
Offline Offline

Activity: 1302
Merit: 1025



View Profile
May 28, 2013, 06:35:52 PM
 #11


Code:
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1002,7 +1002,7 @@ bool GetTransaction(const uint256 &hash, CTransaction &txOut, uint256 &hashBlock
                 if (view.GetCoins(hash, coins))
                     nHeight = coins.nHeight;
             }
-            if (nHeight > 0)
+            if (nHeight >= 0)
                 pindexSlow = FindBlockByHeight(nHeight);
         }
     }

Just FYI, this is a dangerous patch and should not be used.  The genesis generation should not be in your index.  If it is in your index, your node is vulnerable to a fork attack.  An extremely unlikely fork, to be sure, but a hard one.

If you really need the information from that block, you should get it out-of-band, not from your client.

17Np17BSrpnHCZ2pgtiMNnhjnsWJ2TMqq8
I routinely ignore posters with paid advertising in their sigs.  You should too.
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!