Make the relay acknowledge all received commands
To that effect, bump liberty and the xC relay protocol version. Relay events have been reordered to improve forward compatibility. Also prevent use-after-free when serialization fails. xP now slightly throttles activity notifications, and indicates when there are unacknowledged commands.
This commit is contained in:
9
xA/xA.go
9
xA/xA.go
@@ -337,9 +337,14 @@ func relaySend(data RelayCommandData, callback callback) bool {
|
||||
CommandSeq: commandSeq,
|
||||
Data: data,
|
||||
}
|
||||
if callback != nil {
|
||||
commandCallbacks[m.CommandSeq] = callback
|
||||
if callback == nil {
|
||||
callback = func(err string, response *RelayResponseData) {
|
||||
if response == nil {
|
||||
showErrorMessage(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
commandCallbacks[m.CommandSeq] = callback
|
||||
commandSeq++
|
||||
|
||||
// TODO(p): Handle errors better.
|
||||
|
||||
Reference in New Issue
Block a user