janoside / btc-rpc-explorer

Database-free, self-hosted Bitcoin explorer, via RPC to Bitcoin Core.
https://bitcoinexplorer.org
MIT License
1.55k stars 1.17k forks source link

Cannot read property 'vin' of undefined #12

Closed qshuai closed 6 years ago

qshuai commented 6 years ago

I can not write pug code, but I encounter this problem. The problem is viewing some blocks is working well but others not.

/Users/scrapup/cpp/bti/btc-rpc-explorer/views/includes/block-content.pug:126 124| div(class="row") 125| div(class="col-md-6") > 126| h6 Input (#{tx.vin.length.toLocaleString()}) 127| if (result.txInputsByTransaction[tx.txid]) 128| - var totalInputValue = new Decimal(0); 129| table(class="table mb-0") Cannot read property 'vin' of undefined

TypeError: /Users/scrapup/cpp/bti/btc-rpc-explorer/views/includes/block-content.pug:126
    124|                        div(class="row")
    125|                            div(class="col-md-6")
  > 126|                                h6 Input (#{tx.vin.length.toLocaleString()})
    127|                                if (result.txInputsByTransaction[tx.txid])
    128|                                    - var totalInputValue = new Decimal(0);
    129|                                    table(class="table mb-0")

Cannot read property 'vin' of undefined
janoside commented 6 years ago

@scrapup Thanks for reporting this. Please include a link to an example of a block that's causing this error.

qshuai commented 6 years ago

@janoside Thanks for your reply!

I use bitcoin testnet.

There is a error when visit block 1,253,881(or other). But some blocks are ok.

janoside commented 6 years ago

@scrapup Great. I'm spinning up a testnet node right now and I'll investigate shortly.

janoside commented 6 years ago

@qshuai Have you modified block-content.pug? Have you modified any other code? I have a testnet instance of the app running and I'm not getting the same error for testnet block 1,253,881. Also, what version is your bitcoin node?

qshuai commented 6 years ago

@janoside I am so sorry. I encounter this problem because my blocks data are damaged. It is ok now, thanks!

janoside commented 6 years ago

@qshuai No problem. Thanks for the update and glad you got it figured out!