Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
anandrgitnirman authored Apr 1, 2020
2 parents 9d3044c + d139e47 commit 609aac8
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions escrow/control_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,16 +322,23 @@ func (service *ProviderControlService) listClaims() (*PaymentsListReply, error)
output := make([]*PaymentReply, 0)
for _, claimRetrieved := range claimsRetrieved {
payment := claimRetrieved.Payment()
//To Get the Expiration of the Channel ( always get the latest state)
latestChannel, ok, err := service.channelService.PaymentChannel(&PaymentChannelKey{ID: payment.ChannelID})
if !ok || err != nil {
log.Errorf("Unable to retrieve the latest Channel State", payment.ChannelID, payment.ChannelNonce)
continue
}
if payment.Signature == nil || payment.Amount.Int64() == 0 {
log.Errorf("The Signature or the Amount is not defined on the Payment with"+
" Channel Id:%v , Nonce:%v", payment.ChannelID, payment.ChannelNonce)
continue
}
paymentReply := &PaymentReply{
ChannelId: bigIntToBytes(payment.ChannelID),
ChannelNonce: bigIntToBytes(payment.ChannelNonce),
SignedAmount: bigIntToBytes(payment.Amount),
Signature: payment.Signature,
ChannelId: bigIntToBytes(payment.ChannelID),
ChannelNonce: bigIntToBytes(payment.ChannelNonce),
SignedAmount: bigIntToBytes(payment.Amount),
Signature: payment.Signature,
ChannelExpiry: bigIntToBytes(latestChannel.Expiration),
}
output = append(output, paymentReply)
}
Expand Down

0 comments on commit 609aac8

Please sign in to comment.