channeldb: return updated payment on attempt update

Similar to what is done for SettleAttempt.

Co-authored-by: Johan T. Halseth <johanth@gmail.com>
This commit is contained in:
Joost Jager
2020-04-06 09:26:52 +02:00
parent 351d8e174c
commit 278915e598
3 changed files with 50 additions and 36 deletions

View File

@@ -107,7 +107,8 @@ func (p *controlTower) InitPayment(paymentHash lntypes.Hash,
func (p *controlTower) RegisterAttempt(paymentHash lntypes.Hash,
attempt *channeldb.HTLCAttemptInfo) error {
return p.db.RegisterAttempt(paymentHash, attempt)
_, err := p.db.RegisterAttempt(paymentHash, attempt)
return err
}
// SettleAttempt marks the given attempt settled with the preimage. If
@@ -133,7 +134,8 @@ func (p *controlTower) SettleAttempt(paymentHash lntypes.Hash,
func (p *controlTower) FailAttempt(paymentHash lntypes.Hash,
attemptID uint64, failInfo *channeldb.HTLCFailInfo) error {
return p.db.FailAttempt(paymentHash, attemptID, failInfo)
_, err := p.db.FailAttempt(paymentHash, attemptID, failInfo)
return err
}
// FetchPayment fetches the payment corresponding to the given payment hash.