@@ -85,7 +85,7 @@ use bitcoin::secp256k1::{self, Message, PublicKey, Scalar, Secp256k1, SecretKey}
85
85
use lightning:: util:: dyn_signer:: DynSigner ;
86
86
87
87
use std:: cell:: RefCell ;
88
- use std:: cmp:: { self , Ordering } ;
88
+ use std:: cmp;
89
89
use std:: mem;
90
90
use std:: sync:: atomic;
91
91
use std:: sync:: { Arc , Mutex } ;
@@ -1304,28 +1304,6 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out, anchors: bool) {
1304
1304
// deduplicate the calls here.
1305
1305
let mut claim_set = new_hash_map( ) ;
1306
1306
let mut events = nodes[ $node] . get_and_clear_pending_events( ) ;
1307
- // Sort events so that PendingHTLCsForwardable get processed last. This avoids a
1308
- // case where we first process a PendingHTLCsForwardable, then claim/fail on a
1309
- // PaymentClaimable, claiming/failing two HTLCs, but leaving a just-generated
1310
- // PaymentClaimable event for the second HTLC in our pending_events (and breaking
1311
- // our claim_set deduplication).
1312
- events. sort_by( |a, b| {
1313
- if let events:: Event :: PaymentClaimable { .. } = a {
1314
- if let events:: Event :: PendingHTLCsForwardable { .. } = b {
1315
- Ordering :: Less
1316
- } else {
1317
- Ordering :: Equal
1318
- }
1319
- } else if let events:: Event :: PendingHTLCsForwardable { .. } = a {
1320
- if let events:: Event :: PaymentClaimable { .. } = b {
1321
- Ordering :: Greater
1322
- } else {
1323
- Ordering :: Equal
1324
- }
1325
- } else {
1326
- Ordering :: Equal
1327
- }
1328
- } ) ;
1329
1307
let had_events = !events. is_empty( ) ;
1330
1308
for event in events. drain( ..) {
1331
1309
match event {
@@ -1352,9 +1330,6 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out, anchors: bool) {
1352
1330
} ,
1353
1331
events:: Event :: PaymentForwarded { .. } if $node == 1 => { } ,
1354
1332
events:: Event :: ChannelReady { .. } => { } ,
1355
- events:: Event :: PendingHTLCsForwardable { .. } => {
1356
- nodes[ $node] . process_pending_htlc_forwards( ) ;
1357
- } ,
1358
1333
events:: Event :: HTLCHandlingFailed { .. } => { } ,
1359
1334
_ => {
1360
1335
if out. may_fail. load( atomic:: Ordering :: Acquire ) {
@@ -1365,6 +1340,7 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out, anchors: bool) {
1365
1340
} ,
1366
1341
}
1367
1342
}
1343
+ nodes[ $node] . process_pending_htlc_forwards( ) ;
1368
1344
had_events
1369
1345
} } ;
1370
1346
}
@@ -1806,8 +1782,7 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out, anchors: bool) {
1806
1782
last_pass_no_updates = false ;
1807
1783
continue ;
1808
1784
}
1809
- // ...making sure any pending PendingHTLCsForwardable events are handled and
1810
- // payments claimed.
1785
+ // ...making sure any payments are claimed.
1811
1786
if process_events!( 0 , false ) {
1812
1787
last_pass_no_updates = false ;
1813
1788
continue ;
0 commit comments