(0, features, required),
(1, announcement_received_time, (default_value, 0)),
(2, node_one, required),
- (4, one_to_two_wrap, ignorable),
+ (4, one_to_two_wrap, upgradable_required),
(6, node_two, required),
- (8, two_to_one_wrap, ignorable),
+ (8, two_to_one_wrap, upgradable_required),
(10, capacity_sats, required),
(12, announcement_message, required),
});
read_tlv_fields!(reader, {
(0, _lowest_inbound_channel_fees, option),
- (2, announcement_info_wrap, ignorable),
+ (2, announcement_info_wrap, upgradable_required),
(4, channels, vec_type),
});
let mut payment_id = None;
read_tlv_fields!(reader, {
(0, payment_hash, required),
- (1, network_update, ignorable),
+ (1, network_update, upgradable_required),
(2, payment_failed_permanently, required),
(5, path, vec_type),
(7, short_channel_id, option),
read_tlv_fields!(reader, {
(0, channel_id, required),
(1, user_channel_id_low_opt, option),
- (2, reason, ignorable),
+ (2, reason, upgradable_required),
(3, user_channel_id_high_opt, option),
});
if reason.is_none() { return Ok(None); }
read_tlv_fields!(reader, {
(0, payment_hash, required),
(1, receiver_node_id, option),
- (2, purpose, ignorable),
+ (2, purpose, upgradable_required),
(4, amount_msat, required),
});
if purpose.is_none() { return Ok(None); }
let mut failed_next_destination_opt = None;
read_tlv_fields!(reader, {
(0, prev_channel_id, required),
- (2, failed_next_destination_opt, ignorable),
+ (2, failed_next_destination_opt, upgradable_required),
});
if let Some(failed_next_destination) = failed_next_destination_opt {
Ok(Some(Event::HTLCHandlingFailed {
field.write($stream)?;
}
};
- ($stream: expr, $type: expr, $field: expr, ignorable) => {
+ ($stream: expr, $type: expr, $field: expr, upgradable_required) => {
$crate::_encode_tlv!($stream, $type, $field, required);
};
- ($stream: expr, $type: expr, $field: expr, ignorable_option) => {
+ ($stream: expr, $type: expr, $field: expr, upgradable_option) => {
$crate::_encode_tlv!($stream, $type, $field, option);
};
($stream: expr, $type: expr, $field: expr, (option, encoding: ($fieldty: ty, $encoding: ident))) => {
$len.0 += field_len;
}
};
- ($len: expr, $type: expr, $field: expr, ignorable) => {
+ ($len: expr, $type: expr, $field: expr, upgradable_required) => {
$crate::_get_varint_length_prefixed_tlv_length!($len, $type, $field, required);
};
- ($len: expr, $type: expr, $field: expr, ignorable_option) => {
+ ($len: expr, $type: expr, $field: expr, upgradable_option) => {
$crate::_get_varint_length_prefixed_tlv_length!($len, $type, $field, option);
};
}
($last_seen_type: expr, $typ: expr, $type: expr, $field: ident, vec_type) => {{
// no-op
}};
- ($last_seen_type: expr, $typ: expr, $type: expr, $field: ident, ignorable) => {{
+ ($last_seen_type: expr, $typ: expr, $type: expr, $field: ident, upgradable_required) => {{
// no-op
}};
- ($last_seen_type: expr, $typ: expr, $type: expr, $field: ident, ignorable_option) => {{
+ ($last_seen_type: expr, $typ: expr, $type: expr, $field: ident, upgradable_option) => {{
// no-op
}};
($last_seen_type: expr, $typ: expr, $type: expr, $field: ident, (option: $trait: ident $(, $read_arg: expr)?)) => {{
($last_seen_type: expr, $type: expr, $field: ident, option) => {{
// no-op
}};
- ($last_seen_type: expr, $type: expr, $field: ident, ignorable) => {{
+ ($last_seen_type: expr, $type: expr, $field: ident, upgradable_required) => {{
// no-op
}};
- ($last_seen_type: expr, $type: expr, $field: ident, ignorable_option) => {{
+ ($last_seen_type: expr, $type: expr, $field: ident, upgradable_option) => {{
// no-op
}};
($last_seen_type: expr, $type: expr, $field: ident, (option: $trait: ident $(, $read_arg: expr)?)) => {{
($reader: expr, $field: ident, option) => {{
$field = Some($crate::util::ser::Readable::read(&mut $reader)?);
}};
- ($reader: expr, $field: ident, ignorable) => {{
+ ($reader: expr, $field: ident, upgradable_required) => {{
$field = $crate::util::ser::MaybeReadable::read(&mut $reader)?;
}};
- ($reader: expr, $field: ident, ignorable_option) => {{
+ ($reader: expr, $field: ident, upgradable_option) => {{
$field = $crate::util::ser::MaybeReadable::read(&mut $reader)?;
}};
($reader: expr, $field: ident, (option: $trait: ident $(, $read_arg: expr)?)) => {{
($field: ident, option) => {
$field
};
- ($field: ident, ignorable) => {
+ ($field: ident, upgradable_required) => {
if $field.is_none() { return Ok(None); } else { $field.unwrap() }
};
- ($field: ident, ignorable_option) => {
+ ($field: ident, upgradable_option) => {
$field
};
($field: ident, required) => {
($field: ident, option) => {
let mut $field = None;
};
- ($field: ident, ignorable) => {
+ ($field: ident, upgradable_required) => {
let mut $field = None;
};
- ($field: ident, ignorable_option) => {
+ ($field: ident, upgradable_option) => {
let mut $field = None;
};
}