Closed cbarraford closed 6 years ago
Ok, after a bit of painstaking debugging, here's the issue...
line 71 panics because the previous line (line 70) return nil for the idx
value. And the current code doesn't do anything to check for nil
values which eventually causes a panic.
Taking an even deeper dive into why my dev env is getting a nil
value at all, is because of line 322 where we generate the error
leveldb: not found
We then swallow the error, print nothing, and just return nil. Which as you can imagine, doesn't give the user much insight/knowledge into what the actual problem is.
At line 322, we add a error print statement with the error so its more obvious what the problem is. Thoughts? If people agree, i can open an PR.
Well, "not found" isn't referencing leveldb not being installed itself, its refering to a key not being found in the database. Back to the drawing board...
I finally figured out my issue, there seems to be some bad data files in the block database folder. Rm'ing all the files in the testnet (~/Library/Application Support/Btcd/data/testnet/blocks_ffldb
)
While following the instructions, i get the following error while running btcd testnet.