mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-19 12:01:27 +02:00
routing: fix and enhance logging
This commit is contained in:
@@ -424,7 +424,9 @@ func (p *PaymentControl) RegisterAttempt(paymentHash lntypes.Hash,
|
||||
// Ensure we aren't sending more than the total payment amount.
|
||||
sentAmt, _ := payment.SentAmt()
|
||||
if sentAmt+amt > payment.Info.Value {
|
||||
return ErrValueExceedsAmt
|
||||
return fmt.Errorf("%w: attempted=%v, payment amount="+
|
||||
"%v", ErrValueExceedsAmt, sentAmt+amt,
|
||||
payment.Info.Value)
|
||||
}
|
||||
|
||||
htlcsBucket, err := bucket.CreateBucketIfNotExists(
|
||||
|
@@ -734,10 +734,7 @@ func TestPaymentControlMultiShard(t *testing.T) {
|
||||
b := *attempt
|
||||
b.AttemptID = 3
|
||||
_, err = pControl.RegisterAttempt(info.PaymentIdentifier, &b)
|
||||
if err != ErrValueExceedsAmt {
|
||||
t.Fatalf("expected ErrValueExceedsAmt, got: %v",
|
||||
err)
|
||||
}
|
||||
require.ErrorIs(t, err, ErrValueExceedsAmt)
|
||||
|
||||
// Fail the second attempt.
|
||||
a := attempts[1]
|
||||
|
Reference in New Issue
Block a user