Skip to content

Conversation

chappjc
Copy link
Member

@chappjc chappjc commented Jul 7, 2022

  1. Add a peers restored message to match a peers lost message

image

  1. Distinguish peers lost from unable to determine peer count (e.g. rpc timeout)

image

  1. Fix a bug in the DCR block monitoring goroutine. When native SPV was added, some code that made sense in its own function (defer and return) no longer worked properly when put directly into monitorBlocks. The return was killing the wallet if connectivity was lost, instead of it being a temporary issue. This fixes those issues.

image

newTip, err := dcr.getBestBlock(ctx)
if err != nil {
dcr.handleTipChange(nil, 0, fmt.Errorf("failed to get best block: %w", err))
return
Copy link
Member Author

@chappjc chappjc Jul 8, 2022

Choose a reason for hiding this comment

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

This return was the bug that resulted in "client has been shutdown" and unable to reconnect to the wallet without dexc restart. The defer cancel() was also not working as intended, plus it was filling up the defer stack leading to memory exhaustion.

Comment on lines +1812 to +1816
// - overhead from 1 transaction
// - 1 extra signed p2wpkh-spending input. The split tx has the fundingCoins as
// inputs now, but we'll add the input that spends the sized coin that will go
// into the first swap if the split tx does not add excess baggage
// - 2 additional p2wpkh outputs for the split tx sized output and change
Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm, I must have done go fmt with Go 1.19 rc1 which has new formatting. https://tip.golang.org/doc/go1.19#go-doc

Since older gofmt versions don't try to change it back, I think I'll leave it.

@chappjc chappjc added this to the 0.5 milestone Jul 12, 2022
@chappjc chappjc merged commit 6a22100 into decred:master Jul 14, 2022
@chappjc chappjc deleted the peers-restored branch July 14, 2022 21:57
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.

2 participants