mirror of
https://github.com/aljazceru/ark.git
synced 2025-12-18 12:44:19 +01:00
Add RoundFinalizationEvent to PingResponse (#200)
This commit is contained in:
committed by
GitHub
parent
d10c724ced
commit
4ff1c7c87a
@@ -101,13 +101,24 @@ func (h *handler) Ping(ctx context.Context, req *arkv1.PingRequest) (*arkv1.Ping
|
||||
return nil, status.Error(codes.InvalidArgument, "missing payment id")
|
||||
}
|
||||
|
||||
forfeits, err := h.svc.UpdatePaymentStatus(ctx, req.GetPaymentId())
|
||||
forfeits, round, err := h.svc.UpdatePaymentStatus(ctx, req.GetPaymentId())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var event *arkv1.RoundFinalizationEvent
|
||||
if round != nil {
|
||||
event = &arkv1.RoundFinalizationEvent{
|
||||
Id: round.Id,
|
||||
PoolTx: round.UnsignedTx,
|
||||
ForfeitTxs: round.ForfeitTxs,
|
||||
CongestionTree: castCongestionTree(round.CongestionTree),
|
||||
Connectors: round.Connectors,
|
||||
}
|
||||
}
|
||||
return &arkv1.PingResponse{
|
||||
ForfeitTxs: forfeits,
|
||||
Event: event,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user