Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with lastHashStore #13

Open
combwattle opened this issue Feb 17, 2014 · 3 comments
Open

Problem with lastHashStore #13

combwattle opened this issue Feb 17, 2014 · 3 comments

Comments

@combwattle
Copy link

Hi all,

I have been running bitc smoothly until I sent 0.001 btc to the default address assigned by bitc. Afterward, bitc quits automatically while trying to connect to peers showing the following message. Has anybody else seen a similar issue?

ASSERT failed at src/block-store.c:blockstore_get_highest:178
PANIC: Expression 'height1 > 0' not TRUE.
Aborted (core dumped)

I tried to find a relevant section in the code, and it seems like lastHashStore is the immediate cause of the problem. Since peerGroup determines lastHashStore, I suspect that peerGroup is not being set up properly.

peergroup_get_lastblk(btc->peerGroup, &lastHashStore);
blockstore_get_highest(bs, &walletHash, &lastHashStore, &startHash);
...
height0 = blockstore_get_block_height(bs, hash0);
height1 = blockstore_get_block_height(bs, hash1);
ASSERT(height0 > 0);// PANIC

@mx4
Copy link
Contributor

mx4 commented Feb 17, 2014

Ah, cool. I added this ASSERT some time back to catch an instance of a bug I've been tracking for some time. You can basically get rid of the problem by resync'ing your txdb/headers:

./bitc -z

.. and things will/should go smoothly afterwards.

Btw, were you running the top-of-trunk from bitc? IOW, when did you last sync-up your tree?

If that's ok with you, I'd like to debug this a bit and would like to confirm that you're seeing the same issue I was trying to track down when I added this ASSERT. I will ideally need the bitc binary+core dump (beware of the privacy implication, so feel free to say no).

The problem here is that it's possible that the last block we were sync'd at when we last shut down is now an orphan. So when it's time to compute from where we need to refresh the txdb, we find a height of 0 because that block is orphaned..

I know what needs to be done to address this issue (walk backwards from that orphan until we hit the current best chain and use this junction node as a valid sync point), but it's a bit annoying to code (lazy me), so if that proves to be the issue that'll be a good incentive to finally find the time to fixing this.

@combwattle
Copy link
Author

After running ./bitc -z, everything seems to be working again with the latest balance (0.0001 btc).
I can provide bitc binary+core dump. Please let me know how I can perform such operation, and, also, it would be great if you could share an email address, to which I will send the dump. Thanks for your prompt feedback.

@mx4
Copy link
Contributor

mx4 commented Feb 18, 2014

Please send me the (gzipped?) binary & dump at the address in the LICENSE file. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants