Skip to content

dex/encode: empty pushes should load as nil#538

Closed
chappjc wants to merge 1 commit into
decred:masterfrom
chappjc:empty-pushes-nil
Closed

dex/encode: empty pushes should load as nil#538
chappjc wants to merge 1 commit into
decred:masterfrom
chappjc:empty-pushes-nil

Conversation

@chappjc
Copy link
Copy Markdown
Member

@chappjc chappjc commented Jul 8, 2020

This resolves inability to resume matches on dexc restart, maybe resolves #528.

Comment thread client/core/trade.go
func (t *trackedTrade) isRedeemable(match *matchTracker) bool {
dbMatch, metaData, proof, _ := match.parts()
if match.failErr != nil || proof.RefundCoin != nil {
log.Debugf("failErr = %v, RefundCoin = %v", match.failErr, proof.RefundCoin)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Was showing [DBG] CORE: failErr = <nil>, RefundCoin = indicating proof.RefundCoin != nil, an empty but non-nil slice although it was nil when stored to the client DB. More logging == better.

With spew.Dump of the db.MetaMatches, I noticed many other fields, such as signatures and the secret, that were not nil but empty as well.

Comment thread client/core/core.go
Comment on lines +1888 to +1890
// for _, match := range matches {
// match.tracker.tick()
// }
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We might want to tick right away instead of waiting for the ticker to fire.

Comment thread client/core/core.go
}

status := order.MatchStatus(msgMatch.Status)
log.Debugf("registering match %v for order %v in status %v", msgMatch.MatchID, oid, status)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Note that the server-side connect fixes in #531 are necessary for both match messages to be sent on connect.

@chappjc
Copy link
Copy Markdown
Member Author

chappjc commented Jul 14, 2020

Just letting #531 get these changes since there were a few more related commits in that branch.

@chappjc chappjc closed this Jul 14, 2020
@chappjc chappjc deleted the empty-pushes-nil branch October 22, 2020 20:23
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.

swap: checkInaction(failMatch) for unknown reason

1 participant