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

In kaspaminer, don't crash on submitBlock timeout #1462

Merged
merged 5 commits into from
Jan 29, 2021

Conversation

stasatdaglabs
Copy link
Collaborator

@stasatdaglabs stasatdaglabs commented Jan 28, 2021

Solves #1461

@elichai elichai linked an issue Jan 28, 2021 that may be closed by this pull request
@stasatdaglabs stasatdaglabs linked an issue Jan 28, 2021 that may be closed by this pull request
elichai
elichai previously approved these changes Jan 28, 2021
@@ -117,6 +117,10 @@ func handleFoundBlock(client *minerClient, block *externalapi.DomainBlock) error

rejectReason, err := client.SubmitBlock(block)
if err != nil {
if nativeerrors.Is(err, router.ErrTimeout) {
log.Warnf("Got timeout while submitting block %s to %s: %s", blockHash, client.Address(), err)
return nil
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The result of this is that the block will be discarded.
But there's no easy way to solve this right now.
I feel like we should re-write the cpu miner in an async way, that way a separate go-routine will loop trying to submit

@stasatdaglabs stasatdaglabs merged commit 65e149b into v0.9.0-dev Jan 29, 2021
@stasatdaglabs stasatdaglabs deleted the miner-dont-crash-on-timeout branch January 29, 2021 07:10
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

Successfully merging this pull request may close these issues.

Cpu miner bug - testnet ALFA
2 participants