Skip to content

Commit 6dede0e

Browse files
committed
Serialise ChannelMonitors and send them over inside Peer Storage
1 parent 1111f05 commit 6dede0e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lightning/src/chain/chainmonitor.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ use bitcoin::hash_types::{BlockHash, Txid};
2929
use crate::chain;
3030
use crate::chain::chaininterface::{BroadcasterInterface, FeeEstimator};
3131
use crate::chain::channelmonitor::{
32-
write_util, Balance, ChannelMonitor, ChannelMonitorUpdate, MonitorEvent, TransactionOutputs,
32+
write_util_internal, Balance, ChannelMonitor, ChannelMonitorUpdate, MonitorEvent, TransactionOutputs,
3333
WithChannelMonitor,
3434
};
3535
use crate::chain::transaction::{OutPoint, TransactionData};
@@ -835,7 +835,7 @@ where
835835
let counterparty_node_id = mon.monitor.get_counterparty_node_id();
836836
let chan_mon = mon.monitor.inner.lock().unwrap();
837837

838-
match write_util(&chan_mon, true, &mut ser_chan) {
838+
match write_util_internal(&chan_mon, true, &mut ser_chan) {
839839
Ok(_) => {
840840
// Adding size of peer_storage_monitor.
841841
curr_size += ser_chan.0.serialized_length()

lightning/src/chain/channelmonitor.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1350,7 +1350,7 @@ const MIN_SERIALIZATION_VERSION: u8 = 1;
13501350
/// NOTE: `is_stub` is true only when we are using this to serialise for Peer Storage.
13511351
///
13521352
/// [`ChainMonitor`]: crate::chain::chainmonitor::ChainMonitor
1353-
pub(crate) fn write_util<Signer: EcdsaChannelSigner, W: Writer>(
1353+
pub(crate) fn write_util_internal<Signer: EcdsaChannelSigner, W: Writer>(
13541354
channel_monitor: &ChannelMonitorImpl<Signer>, is_stub: bool, writer: &mut W,
13551355
) -> Result<(), Error> {
13561356
write_ver_prefix!(writer, SERIALIZATION_VERSION, MIN_SERIALIZATION_VERSION);
@@ -1592,7 +1592,7 @@ pub(crate) fn write_util<Signer: EcdsaChannelSigner, W: Writer>(
15921592

15931593
impl<Signer: EcdsaChannelSigner> Writeable for ChannelMonitorImpl<Signer> {
15941594
fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error> {
1595-
write_util(self, false, writer)
1595+
write_util_internal(self, false, writer)
15961596
}
15971597
}
15981598

0 commit comments

Comments
 (0)