Skip to content

Commit 25d8804

Browse files
committed
do not return Result in ChannelManager constructor
* Since it is now pointless.
1 parent 7b2577d commit 25d8804

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

bindings/src/channelmanager.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ pub(crate) fn construct_channel_manager(
9797
get_est_sat_per_1000_weight_ptr: Ref<fee_estimator_fn::GetEstSatPer1000WeightPtr>,
9898
cur_block_height: usize,
9999

100-
) -> Result<FFIArcChannelManager, secp256k1::Error> {
100+
) -> FFIArcChannelManager {
101101
let network = ffi_network.to_network();
102102
let now = SystemTime::now().duration_since(UNIX_EPOCH).unwrap();
103103
let mut seed: [u8; 32] = unsafe_block!("it points to valid length buffer" => seed.as_ref()).clone().bytes;
@@ -176,7 +176,7 @@ ffi! {
176176
log_ref,
177177
get_est_sat_per_1000_weight_ptr,
178178
cur_block_height,
179-
)?;
179+
);
180180
unsafe_block!("We know chan_man is not null by wrapper macro. And we know `Out` is writable" => chan_man.init(HandleShared::alloc(chan_man_raw)));
181181
FFIResult::ok()
182182
}

lightning/src/ln/channelmanager.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -771,10 +771,10 @@ impl<ChanSigner: ChannelKeys, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref>
771771
/// the ChannelManager as a listener to the BlockNotifier and call the BlockNotifier's
772772
/// `block_(dis)connected` methods, which will notify all registered listeners in one
773773
/// go.
774-
pub fn new(network: Network, fee_est: F, monitor: M, tx_broadcaster: T, logger: L, keys_manager: K, config: UserConfig, current_blockchain_height: usize) -> Result<ChannelManager<ChanSigner, M, T, K, F, L>, secp256k1::Error> {
774+
pub fn new(network: Network, fee_est: F, monitor: M, tx_broadcaster: T, logger: L, keys_manager: K, config: UserConfig, current_blockchain_height: usize) -> ChannelManager<ChanSigner, M, T, K, F, L> {
775775
let secp_ctx = Secp256k1::new();
776776

777-
let res = ChannelManager {
777+
ChannelManager {
778778
default_configuration: config.clone(),
779779
genesis_hash: genesis_block(network).header.bitcoin_hash(),
780780
fee_estimator: fee_est,
@@ -804,9 +804,7 @@ impl<ChanSigner: ChannelKeys, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref>
804804
keys_manager,
805805

806806
logger,
807-
};
808-
809-
Ok(res)
807+
}
810808
}
811809

812810
/// Creates a new outbound channel to the given remote node and with the given value.

0 commit comments

Comments
 (0)