]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Merge pull request #1434 from TheBlueMatt/2022-04-robust-payment-claims
authorvalentinewallace <valentinewallace@users.noreply.github.com>
Mon, 30 May 2022 17:05:01 +0000 (10:05 -0700)
committerGitHub <noreply@github.com>
Mon, 30 May 2022 17:05:01 +0000 (10:05 -0700)
Improve Robustness of Inbound MPP Claims Across Restart

1  2 
lightning/src/chain/channelmonitor.rs
lightning/src/ln/chanmon_update_fail_tests.rs
lightning/src/ln/channel.rs
lightning/src/ln/channelmanager.rs
lightning/src/ln/functional_test_utils.rs
lightning/src/ln/functional_tests.rs
lightning/src/ln/monitor_tests.rs
lightning/src/ln/payment_tests.rs
lightning/src/ln/reorg_tests.rs
lightning/src/util/events.rs

Simple merge
Simple merge
Simple merge
index f5d2bc8a042f4582fb4ad277507dccd475cd4517,d1a68a90823b2783e660788effb938c29e795e93..8eb001941f763a51fd8a6535f814f8b6e7c528a3
@@@ -8749,15 -8737,16 +8772,17 @@@ fn test_update_err_monitor_lockdown() 
                watchtower
        };
        let header = BlockHeader { version: 0x20000000, prev_blockhash: Default::default(), merkle_root: Default::default(), time: 42, bits: 42, nonce: 42 };
 +      let block = Block { header, txdata: vec![] };
        // Make the tx_broadcaster aware of enough blocks that it doesn't think we're violating
        // transaction lock time requirements here.
 -      chanmon_cfgs[0].tx_broadcaster.blocks.lock().unwrap().resize(200, (header, 0));
 -      watchtower.chain_monitor.block_connected(&Block { header, txdata: vec![] }, 200);
 +      chanmon_cfgs[0].tx_broadcaster.blocks.lock().unwrap().resize(200, (block.clone(), 0));
 +      watchtower.chain_monitor.block_connected(&block, 200);
  
        // Try to update ChannelMonitor
-       assert!(nodes[1].node.claim_funds(preimage));
+       nodes[1].node.claim_funds(preimage);
        check_added_monitors!(nodes[1], 1);
+       expect_payment_claimed!(nodes[1], payment_hash, 9_000_000);
        let updates = get_htlc_update_msgs!(nodes[1], nodes[0].node.get_our_node_id());
        assert_eq!(updates.update_fulfill_htlcs.len(), 1);
        nodes[0].node.handle_update_fulfill_htlc(&nodes[1].node.get_our_node_id(), &updates.update_fulfill_htlcs[0]);
Simple merge
Simple merge
Simple merge
Simple merge