Skip to content

Commit 16cff3f

Browse files
committed
f Use Option<bool> accountable field in UpdateAddHTLC
1 parent 68f3f43 commit 16cff3f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ use crate::ln::inbound_payment;
6868
use crate::ln::interactivetxs::InteractiveTxMessageSend;
6969
use crate::ln::msgs;
7070
use crate::ln::msgs::{
71-
accountable_into_bool, BaseMessageHandler, ChannelMessageHandler, CommitmentUpdate,
72-
DecodeError, LightningError, MessageSendEvent,
71+
BaseMessageHandler, ChannelMessageHandler, CommitmentUpdate, DecodeError, LightningError,
72+
MessageSendEvent,
7373
};
7474
use crate::ln::onion_payment::{
7575
check_incoming_htlc_cltv, create_fwd_pending_htlc_info, create_recv_pending_htlc_info,
@@ -5103,7 +5103,7 @@ where
51035103
let current_height: u32 = self.best_block.read().unwrap().height;
51045104
create_recv_pending_htlc_info(decoded_hop, shared_secret, msg.payment_hash,
51055105
msg.amount_msat, msg.cltv_expiry, None, allow_underpay, msg.skimmed_fee_msat,
5106-
accountable_into_bool(msg.accountable), current_height)
5106+
msg.accountable.unwrap_or(false), current_height)
51075107
},
51085108
onion_utils::Hop::Forward { .. } | onion_utils::Hop::BlindedForward { .. } => {
51095109
create_fwd_pending_htlc_info(msg, decoded_hop, shared_secret, next_packet_pubkey_opt)

lightning/src/ln/onion_payment.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use crate::ln::channelmanager::{
1515
BlindedFailure, BlindedForward, HTLCFailureMsg, PendingHTLCInfo, PendingHTLCRouting,
1616
CLTV_FAR_FAR_AWAY, MIN_CLTV_EXPIRY_DELTA,
1717
};
18-
use crate::ln::msgs::{self, accountable_into_bool};
18+
use crate::ln::msgs;
1919
use crate::ln::onion_utils;
2020
use crate::ln::onion_utils::{HTLCFailReason, LocalHTLCFailureReason, ONION_DATA_LEN};
2121
use crate::sign::{NodeSigner, Recipient};
@@ -267,7 +267,7 @@ pub(super) fn create_fwd_pending_htlc_info(
267267
outgoing_amt_msat: amt_to_forward,
268268
outgoing_cltv_value,
269269
skimmed_fee_msat: None,
270-
incoming_accountable: accountable_into_bool(msg.accountable),
270+
incoming_accountable: msg.accountable.unwrap_or(false),
271271
})
272272
}
273273

@@ -523,7 +523,7 @@ where
523523
create_recv_pending_htlc_info(
524524
hop, shared_secret, msg.payment_hash, msg.amount_msat, msg.cltv_expiry,
525525
None, allow_skimmed_fees, msg.skimmed_fee_msat,
526-
accountable_into_bool(msg.accountable), cur_height,
526+
msg.accountable.unwrap_or(false), cur_height,
527527
)?
528528
}
529529
})

0 commit comments

Comments
 (0)