use lightning::sign::{KeyMaterial, InMemorySigner, Recipient, EntropySource, NodeSigner, SignerProvider};
use lightning::events;
use lightning::events::MessageSendEventsProvider;
-use lightning::ln::{PaymentHash, PaymentPreimage, PaymentSecret};
+use lightning::ln::{ChannelId, PaymentHash, PaymentPreimage, PaymentSecret};
use lightning::ln::channelmanager::{ChainParameters, ChannelDetails, ChannelManager, PaymentSendFailure, ChannelManagerReadArgs, PaymentId, RecipientOnionFields};
use lightning::ln::channel::FEE_SPIKE_BUFFER_FEE_INCREASE_MULTIPLE;
use lightning::ln::msgs::{self, CommitmentUpdate, ChannelMessageHandler, DecodeError, UpdateAddHTLC, Init};
self.chain_monitor.update_channel(funding_txo, update)
}
- fn release_pending_monitor_events(&self) -> Vec<(OutPoint, Vec<MonitorEvent>, Option<PublicKey>)> {
+ fn release_pending_monitor_events(&self) -> Vec<(OutPoint, ChannelId, Vec<MonitorEvent>, Option<PublicKey>)> {
return self.chain_monitor.release_pending_monitor_events();
}
}
},
0x89 => { fee_est_c.ret_val.store(253, atomic::Ordering::Release); nodes[2].maybe_update_chan_fees(); },
+ 0xf0 => {
+ let pending_updates = monitor_a.chain_monitor.list_pending_monitor_updates().remove(&chan_1_funding).unwrap();
+ if let Some(id) = pending_updates.get(0) {
+ monitor_a.chain_monitor.channel_monitor_updated(chan_1_funding, *id).unwrap();
+ }
+ nodes[0].process_monitor_events();
+ }
+ 0xf1 => {
+ let pending_updates = monitor_a.chain_monitor.list_pending_monitor_updates().remove(&chan_1_funding).unwrap();
+ if let Some(id) = pending_updates.get(1) {
+ monitor_a.chain_monitor.channel_monitor_updated(chan_1_funding, *id).unwrap();
+ }
+ nodes[0].process_monitor_events();
+ }
+ 0xf2 => {
+ let pending_updates = monitor_a.chain_monitor.list_pending_monitor_updates().remove(&chan_1_funding).unwrap();
+ if let Some(id) = pending_updates.last() {
+ monitor_a.chain_monitor.channel_monitor_updated(chan_1_funding, *id).unwrap();
+ }
+ nodes[0].process_monitor_events();
+ }
+
+ 0xf4 => {
+ let pending_updates = monitor_b.chain_monitor.list_pending_monitor_updates().remove(&chan_1_funding).unwrap();
+ if let Some(id) = pending_updates.get(0) {
+ monitor_b.chain_monitor.channel_monitor_updated(chan_1_funding, *id).unwrap();
+ }
+ nodes[1].process_monitor_events();
+ }
+ 0xf5 => {
+ let pending_updates = monitor_b.chain_monitor.list_pending_monitor_updates().remove(&chan_1_funding).unwrap();
+ if let Some(id) = pending_updates.get(1) {
+ monitor_b.chain_monitor.channel_monitor_updated(chan_1_funding, *id).unwrap();
+ }
+ nodes[1].process_monitor_events();
+ }
+ 0xf6 => {
+ let pending_updates = monitor_b.chain_monitor.list_pending_monitor_updates().remove(&chan_1_funding).unwrap();
+ if let Some(id) = pending_updates.last() {
+ monitor_b.chain_monitor.channel_monitor_updated(chan_1_funding, *id).unwrap();
+ }
+ nodes[1].process_monitor_events();
+ }
+
+ 0xf8 => {
+ let pending_updates = monitor_b.chain_monitor.list_pending_monitor_updates().remove(&chan_2_funding).unwrap();
+ if let Some(id) = pending_updates.get(0) {
+ monitor_b.chain_monitor.channel_monitor_updated(chan_2_funding, *id).unwrap();
+ }
+ nodes[1].process_monitor_events();
+ }
+ 0xf9 => {
+ let pending_updates = monitor_b.chain_monitor.list_pending_monitor_updates().remove(&chan_2_funding).unwrap();
+ if let Some(id) = pending_updates.get(1) {
+ monitor_b.chain_monitor.channel_monitor_updated(chan_2_funding, *id).unwrap();
+ }
+ nodes[1].process_monitor_events();
+ }
+ 0xfa => {
+ let pending_updates = monitor_b.chain_monitor.list_pending_monitor_updates().remove(&chan_2_funding).unwrap();
+ if let Some(id) = pending_updates.last() {
+ monitor_b.chain_monitor.channel_monitor_updated(chan_2_funding, *id).unwrap();
+ }
+ nodes[1].process_monitor_events();
+ }
+
+ 0xfc => {
+ let pending_updates = monitor_c.chain_monitor.list_pending_monitor_updates().remove(&chan_2_funding).unwrap();
+ if let Some(id) = pending_updates.get(0) {
+ monitor_c.chain_monitor.channel_monitor_updated(chan_2_funding, *id).unwrap();
+ }
+ nodes[2].process_monitor_events();
+ }
+ 0xfd => {
+ let pending_updates = monitor_c.chain_monitor.list_pending_monitor_updates().remove(&chan_2_funding).unwrap();
+ if let Some(id) = pending_updates.get(1) {
+ monitor_c.chain_monitor.channel_monitor_updated(chan_2_funding, *id).unwrap();
+ }
+ nodes[2].process_monitor_events();
+ }
+ 0xfe => {
+ let pending_updates = monitor_c.chain_monitor.list_pending_monitor_updates().remove(&chan_2_funding).unwrap();
+ if let Some(id) = pending_updates.last() {
+ monitor_c.chain_monitor.channel_monitor_updated(chan_2_funding, *id).unwrap();
+ }
+ nodes[2].process_monitor_events();
+ }
+
0xff => {
// Test that no channel is in a stuck state where neither party can send funds even
// after we resolve all pending events.