@@ -1439,22 +1439,23 @@ impl<K: KVStore + Sync + Send + 'static> Node<K> {
1439
1439
}
1440
1440
Err ( payment:: PaymentError :: Sending ( e) ) => {
1441
1441
log_error ! ( self . logger, "Failed to send payment: {:?}" , e) ;
1442
-
1443
- let payment = PaymentDetails {
1444
- preimage : None ,
1445
- hash : payment_hash,
1446
- secret : payment_secret,
1447
- amount_msat : invoice. amount_milli_satoshis ( ) ,
1448
- direction : PaymentDirection :: Outbound ,
1449
- status : PaymentStatus :: SendingFailed ,
1450
- } ;
1451
- self . payment_store . insert ( payment) ?;
1452
-
1453
1442
match e {
1454
1443
channelmanager:: RetryableSendFailure :: DuplicatePayment => {
1455
1444
Err ( Error :: DuplicatePayment )
1456
1445
}
1457
- _ => Err ( Error :: PaymentSendingFailed ) ,
1446
+ _ => {
1447
+ let payment = PaymentDetails {
1448
+ preimage : None ,
1449
+ hash : payment_hash,
1450
+ secret : payment_secret,
1451
+ amount_msat : invoice. amount_milli_satoshis ( ) ,
1452
+ direction : PaymentDirection :: Outbound ,
1453
+ status : PaymentStatus :: SendingFailed ,
1454
+ } ;
1455
+
1456
+ self . payment_store . insert ( payment) ?;
1457
+ Err ( Error :: PaymentSendingFailed )
1458
+ }
1458
1459
}
1459
1460
}
1460
1461
}
@@ -1541,21 +1542,23 @@ impl<K: KVStore + Sync + Send + 'static> Node<K> {
1541
1542
Err ( payment:: PaymentError :: Sending ( e) ) => {
1542
1543
log_error ! ( self . logger, "Failed to send payment: {:?}" , e) ;
1543
1544
1544
- let payment = PaymentDetails {
1545
- hash : payment_hash,
1546
- preimage : None ,
1547
- secret : payment_secret,
1548
- amount_msat : Some ( amount_msat) ,
1549
- direction : PaymentDirection :: Outbound ,
1550
- status : PaymentStatus :: SendingFailed ,
1551
- } ;
1552
- self . payment_store . insert ( payment) ?;
1553
-
1554
1545
match e {
1555
1546
channelmanager:: RetryableSendFailure :: DuplicatePayment => {
1556
1547
Err ( Error :: DuplicatePayment )
1557
1548
}
1558
- _ => Err ( Error :: PaymentSendingFailed ) ,
1549
+ _ => {
1550
+ let payment = PaymentDetails {
1551
+ hash : payment_hash,
1552
+ preimage : None ,
1553
+ secret : payment_secret,
1554
+ amount_msat : Some ( amount_msat) ,
1555
+ direction : PaymentDirection :: Outbound ,
1556
+ status : PaymentStatus :: SendingFailed ,
1557
+ } ;
1558
+ self . payment_store . insert ( payment) ?;
1559
+
1560
+ Err ( Error :: PaymentSendingFailed )
1561
+ }
1559
1562
}
1560
1563
}
1561
1564
}
@@ -1614,21 +1617,23 @@ impl<K: KVStore + Sync + Send + 'static> Node<K> {
1614
1617
Err ( e) => {
1615
1618
log_error ! ( self . logger, "Failed to send payment: {:?}" , e) ;
1616
1619
1617
- let payment = PaymentDetails {
1618
- hash : payment_hash,
1619
- preimage : Some ( payment_preimage) ,
1620
- secret : None ,
1621
- status : PaymentStatus :: SendingFailed ,
1622
- direction : PaymentDirection :: Outbound ,
1623
- amount_msat : Some ( amount_msat) ,
1624
- } ;
1625
- self . payment_store . insert ( payment) ?;
1626
-
1627
1620
match e {
1628
1621
channelmanager:: RetryableSendFailure :: DuplicatePayment => {
1629
1622
Err ( Error :: DuplicatePayment )
1630
1623
}
1631
- _ => Err ( Error :: PaymentSendingFailed ) ,
1624
+ _ => {
1625
+ let payment = PaymentDetails {
1626
+ hash : payment_hash,
1627
+ preimage : Some ( payment_preimage) ,
1628
+ secret : None ,
1629
+ status : PaymentStatus :: SendingFailed ,
1630
+ direction : PaymentDirection :: Outbound ,
1631
+ amount_msat : Some ( amount_msat) ,
1632
+ } ;
1633
+
1634
+ self . payment_store . insert ( payment) ?;
1635
+ Err ( Error :: PaymentSendingFailed )
1636
+ }
1632
1637
}
1633
1638
}
1634
1639
}
0 commit comments