From: valentinewallace Date: Mon, 30 May 2022 17:05:01 +0000 (-0700) Subject: Merge pull request #1434 from TheBlueMatt/2022-04-robust-payment-claims X-Git-Tag: v0.0.107~12 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=a534a5e7af4923122a359005a99f01cfb33b451c;p=rust-lightning Merge pull request #1434 from TheBlueMatt/2022-04-robust-payment-claims Improve Robustness of Inbound MPP Claims Across Restart --- a534a5e7af4923122a359005a99f01cfb33b451c diff --cc lightning/src/ln/functional_tests.rs index f5d2bc8a0,d1a68a908..8eb001941 --- a/lightning/src/ln/functional_tests.rs +++ b/lightning/src/ln/functional_tests.rs @@@ -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]);