-
Notifications
You must be signed in to change notification settings - Fork 102
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
multi: allow no dcr reg fee config on server, remove dcr-specific fields #2293
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -883,32 +883,6 @@ func (dc *dexConnection) refreshServerConfig() (*msgjson.ConfigResult, error) { | |
} | ||
} | ||
|
||
// Patch ConfigResponse.RegFees if no entry for DCR is there, meaning it is | ||
// likely an older server using cfg.Fee and cfg.RegFeeConfirms. | ||
if dcrAsset := cfg.RegFees["dcr"]; dcrAsset == nil { | ||
dc.log.Warnf("Legacy server %v does not provide a regFees map.", dc.acct.host) | ||
if cfg.RegFees == nil { | ||
cfg.RegFees = make(map[string]*msgjson.FeeAsset) | ||
} | ||
if cfg.Fee > 0 { | ||
cfg.RegFees["dcr"] = &msgjson.FeeAsset{ // v0 is only DCR | ||
ID: 42, | ||
Confs: uint32(cfg.RegFeeConfirms), | ||
Amt: cfg.Fee, | ||
} | ||
} else { | ||
dc.log.Warnf("Server %v does not support DCR for registration", dc.acct.host) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Released clients will warn about this, but it's no longer an issue. |
||
} | ||
} else { | ||
if cfg.Fee > 0 && dcrAsset.Amt != cfg.Fee { | ||
dc.log.Warnf("Inconsistent DCR fee amount: %d != %d", dcrAsset.Amt, cfg.Fee) | ||
} | ||
if dcrAsset.Confs != uint32(cfg.RegFeeConfirms) { | ||
dc.log.Warnf("Inconsistent DCR fee confirmation requirement: %d != %d", | ||
dcrAsset.Confs, cfg.RegFeeConfirms) | ||
} | ||
Comment on lines
-903
to
-909
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Released clients will also warn about this because these dcr-specific fields will be zero with a server running the code changes in this PR, but the clients will still use any set DCR values in the |
||
} | ||
|
||
// Update the dex connection with the new config details, including | ||
// StartEpoch and FinalEpoch, and rebuild the market data maps. | ||
dc.cfgMtx.Lock() | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1295,9 +1295,7 @@ type ConfigResult struct { | |
// by bond version. | ||
BondExpiry uint64 `json:"DEV_bondExpiry"` | ||
|
||
RegFees map[string]*FeeAsset `json:"regFees"` | ||
Fee uint64 `json:"fee"` // DEPRECATED | ||
RegFeeConfirms uint16 `json:"regfeeconfirms"` // DEPRECATED | ||
Comment on lines
-1299
to
-1300
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Released clients will see a |
||
RegFees map[string]*FeeAsset `json:"regFees"` | ||
} | ||
|
||
// Spot is a snapshot of a market at the end of a match cycle. A slice of Spot | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Release clients will incorrectly refer to this as a "Legacy server" if the server lacks a DCR entry in the map, but the behavior is otherwise fine (block registering with DCR).