Skip to content

Commit 07f12f7

Browse files
committed
f rust 1.36, 1.41
1 parent 02c20ca commit 07f12f7

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,16 @@ jobs:
125125
if: "! matrix.build-net-tokio"
126126
run: |
127127
cargo test --verbose --color always -p lightning
128-
cargo test --verbose --color always --features=test_utils -p lightning-invoice
128+
# this one is different because rust 1.41 doesn't allow features in a virtual workspace root
129+
(cd lightning-invoice && cargo test --verbose --color always --features=test_utils)
129130
cargo build --verbose --color always -p lightning-persister
130131
cargo build --verbose --color always -p lightning-background-processor
131132
- name: Test C Bindings Modifications on Rust ${{ matrix.toolchain }}
132133
if: "! matrix.build-net-tokio"
133134
run: |
134135
RUSTFLAGS="--cfg=c_bindings" cargo test --verbose --color always -p lightning
135-
RUSTFLAGS="--cfg=c_bindings" cargo test --verbose --color always --features=test_utils -p lightning-invoice
136+
# this one is different because rust 1.41 doesn't allow features in a virtual workspace root
137+
(cd lightning-invoice && RUSTFLAGS="--cfg=c_bindings" cargo test --verbose --color always --features=test_utils)
136138
RUSTFLAGS="--cfg=c_bindings" cargo build --verbose --color always -p lightning-persister
137139
RUSTFLAGS="--cfg=c_bindings" cargo build --verbose --color always -p lightning-background-processor
138140
- name: Test Block Sync Clients on Rust ${{ matrix.toolchain }} with features

lightning-invoice/src/payment.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -339,10 +339,11 @@ where
339339
fn pay_internal<F: FnOnce(&Route) -> Result<PaymentId, PaymentSendFailure> + Copy>(
340340
&self, params: &RouteParameters, payment_hash: PaymentHash, send_payment: F,
341341
) -> Result<PaymentId, PaymentError> {
342-
#[cfg(feature = "std")]
343-
if has_expired(params) {
344-
log_trace!(self.logger, "Invoice expired prior to send for payment {}", log_bytes!(payment_hash.0));
345-
return Err(PaymentError::Invoice("Invoice expired prior to send"));
342+
#[cfg(feature = "std")] {
343+
if has_expired(params) {
344+
log_trace!(self.logger, "Invoice expired prior to send for payment {}", log_bytes!(payment_hash.0));
345+
return Err(PaymentError::Invoice("Invoice expired prior to send"));
346+
}
346347
}
347348

348349
let payer = self.payer.node_id();
@@ -402,10 +403,11 @@ where
402403
return Err(());
403404
}
404405

405-
#[cfg(feature = "std")]
406-
if has_expired(params) {
407-
log_trace!(self.logger, "Invoice expired for payment {}; not retrying (attempts: {})", log_bytes!(payment_hash.0), attempts);
408-
return Err(());
406+
#[cfg(feature = "std")] {
407+
if has_expired(params) {
408+
log_trace!(self.logger, "Invoice expired for payment {}; not retrying (attempts: {})", log_bytes!(payment_hash.0), attempts);
409+
return Err(());
410+
}
409411
}
410412

411413
let payer = self.payer.node_id();

0 commit comments

Comments
 (0)