This repository was archived by the owner on Feb 3, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -998,6 +998,10 @@ impl<S: MutinyStorage> MutinyWallet<S> {
998
998
. or ( amt_sats. map ( |x| x * 1_000 ) )
999
999
. ok_or ( MutinyError :: InvoiceInvalid ) ?;
1000
1000
1001
+ // set labels now, need to set it before in case the payment times out
1002
+ self . storage
1003
+ . set_invoice_labels ( inv. clone ( ) , labels. clone ( ) ) ?;
1004
+
1001
1005
// Try each federation first
1002
1006
let federation_ids = self . list_federation_ids ( ) . await ?;
1003
1007
let mut last_federation_error = None ;
@@ -1012,7 +1016,6 @@ impl<S: MutinyStorage> MutinyWallet<S> {
1012
1016
. await ;
1013
1017
match payment_result {
1014
1018
Ok ( r) => {
1015
- self . storage . set_invoice_labels ( inv. clone ( ) , labels) ?;
1016
1019
return Ok ( r) ;
1017
1020
}
1018
1021
Err ( e) => match e {
@@ -1050,12 +1053,9 @@ impl<S: MutinyStorage> MutinyWallet<S> {
1050
1053
. sum :: < u64 > ( )
1051
1054
> 0
1052
1055
{
1053
- let res = self
1054
- . node_manager
1055
- . pay_invoice ( None , inv, amt_sats, labels. clone ( ) )
1056
- . await ?;
1057
- self . storage . set_invoice_labels ( inv. clone ( ) , labels) ?;
1058
- Ok ( res)
1056
+ self . node_manager
1057
+ . pay_invoice ( None , inv, amt_sats, labels)
1058
+ . await
1059
1059
} else {
1060
1060
Err ( last_federation_error. unwrap_or ( MutinyError :: InsufficientBalance ) )
1061
1061
}
You can’t perform that action at this time.
0 commit comments