• About
  • Privacy Poilicy
  • Disclaimer
  • Contact
CoinInsight
  • Home
  • Bitcoin
  • Ethereum
  • Regulation
  • Market
  • Blockchain
  • Ripple
  • Future of Crypto
  • Crypto Mining
No Result
View All Result
  • Home
  • Bitcoin
  • Ethereum
  • Regulation
  • Market
  • Blockchain
  • Ripple
  • Future of Crypto
  • Crypto Mining
No Result
View All Result
CoinInsight
No Result
View All Result
Home Bitcoin

lightning improvement equipment – Greatest manner so as to add my very own wire message to LDK

Coininsight by Coininsight
March 10, 2025
in Bitcoin
0
lightning improvement equipment – Greatest manner so as to add my very own wire message to LDK
189
SHARES
1.5k
VIEWS
Share on FacebookShare on Twitter


I see that we should implement Readable and Writable for wire messages (+ different issues) at rust-lightning/lightning/src/ln/msgs.rs#L3673-L3698.

However I didn’t get the distinction between (utilizing present WarningMessage as instance):

impl Writeable for WarningMessage {
    fn write(&self, w: &mut W) -> End result<(), io::Error> {
        self.channel_id.write(w)?;
        (self.information.len() as u16).write(w)?;
        w.write_all(self.information.as_bytes())?;
        Okay(())
    }
}

impl Readable for WarningMessage {
    fn learn(r: &mut R) -> End result {
        Okay(Self {
            channel_id: Readable::learn(r)?,
            information: {
                let sz: usize = ::learn(r)? as usize;
                let mut information = Vec::with_capacity(sz);
                information.resize(sz, 0);
                r.read_exact(&mut information)?;
                match String::from_utf8(information) {
                    Okay(s) => s,
                    Err(_) => return Err(DecodeError::InvalidValue),
                }
            }
        })
    }
}

And:

impl_writeable_msg!(WarningMessage, {
    channel_id,
    information,
}, {});

Each passes the check:

cargo check --package lightning --lib -- ln::msgs::exams::encoding_warning --exact --show-output

Related articles

Bitcoin Logs Third Weekly Achieve as ETF Cash Quietly Flows In

Bitcoin Logs Third Weekly Achieve as ETF Cash Quietly Flows In

January 17, 2026
Nexo Hit With $500K California High-quality Over ‘Illegal’ Mortgage Practices

Nexo Hit With $500K California High-quality Over ‘Illegal’ Mortgage Practices

January 16, 2026


I see that we should implement Readable and Writable for wire messages (+ different issues) at rust-lightning/lightning/src/ln/msgs.rs#L3673-L3698.

However I didn’t get the distinction between (utilizing present WarningMessage as instance):

impl Writeable for WarningMessage {
    fn write(&self, w: &mut W) -> End result<(), io::Error> {
        self.channel_id.write(w)?;
        (self.information.len() as u16).write(w)?;
        w.write_all(self.information.as_bytes())?;
        Okay(())
    }
}

impl Readable for WarningMessage {
    fn learn(r: &mut R) -> End result {
        Okay(Self {
            channel_id: Readable::learn(r)?,
            information: {
                let sz: usize = ::learn(r)? as usize;
                let mut information = Vec::with_capacity(sz);
                information.resize(sz, 0);
                r.read_exact(&mut information)?;
                match String::from_utf8(information) {
                    Okay(s) => s,
                    Err(_) => return Err(DecodeError::InvalidValue),
                }
            }
        })
    }
}

And:

impl_writeable_msg!(WarningMessage, {
    channel_id,
    information,
}, {});

Each passes the check:

cargo check --package lightning --lib -- ln::msgs::exams::encoding_warning --exact --show-output

Tags: addDevelopmentkitLDKLightningmessagewire
Share76Tweet47

Related Posts

Bitcoin Logs Third Weekly Achieve as ETF Cash Quietly Flows In

Bitcoin Logs Third Weekly Achieve as ETF Cash Quietly Flows In

by Coininsight
January 17, 2026
0

Bitcoin simply notched its third straight weekly achieve for the primary time since July. Bitcoin USD hovered close to latest...

Nexo Hit With $500K California High-quality Over ‘Illegal’ Mortgage Practices

Nexo Hit With $500K California High-quality Over ‘Illegal’ Mortgage Practices

by Coininsight
January 16, 2026
0

Trusted Editorial content material, reviewed by main trade consultants and seasoned editors. Advert Disclosure Nexo, a crypto lending platform, agreed...

$0.15 Break Is The Set off

$0.15 Break Is The Set off

by Coininsight
January 16, 2026
0

Dogecoin (DOGE) is making an attempt to base on larger timeframes as Cantonese Cat factors to a possible inverse head-and-shoulders...

Senate Democrats, Crypto Reps Resume Talks After Invoice Delay

Senate Democrats, Crypto Reps Resume Talks After Invoice Delay

by Coininsight
January 16, 2026
0

U.S. Senate Democrats are reportedly set to reopen talks with representatives from the cryptocurrency trade on Friday, in accordance to...

Bitcoin Hits $96K As CZ Calls $200K Rally “Apparent”

Bitcoin Hits $96K As CZ Calls $200K Rally “Apparent”

by Coininsight
January 15, 2026
0

Be a part of Our Telegram channel to remain updated on breaking information protection Bitcoin worth broke out of a...

Load More
  • Trending
  • Comments
  • Latest
MetaMask Launches An NFT Reward Program – Right here’s Extra Data..

MetaMask Launches An NFT Reward Program – Right here’s Extra Data..

July 24, 2025
Haedal token airdrop information

Haedal token airdrop information

April 24, 2025
BitHub 77-Bit token airdrop information

BitHub 77-Bit token airdrop information

February 6, 2025
MilkyWay ($milkTIA, $MILK) Token Airdrop Information

MilkyWay ($milkTIA, $MILK) Token Airdrop Information

March 4, 2025
Kuwait bans Bitcoin mining over power issues and authorized violations

Kuwait bans Bitcoin mining over power issues and authorized violations

2
The Ethereum Basis’s Imaginative and prescient | Ethereum Basis Weblog

The Ethereum Basis’s Imaginative and prescient | Ethereum Basis Weblog

2
Unchained Launches Multi-Million Greenback Bitcoin Legacy Mission

Unchained Launches Multi-Million Greenback Bitcoin Legacy Mission

1
Earnings Preview: Microsoft anticipated to report larger Q3 income, revenue

Earnings Preview: Microsoft anticipated to report larger Q3 income, revenue

1
Ripple CEO Feedback On Newest CPI Information – Right here’s What He Mentioned

Ripple CEO Feedback On Newest CPI Information – Right here’s What He Mentioned

January 17, 2026
White Home Might Drop Crypto Invoice After Coinbase Withdrawal: Report

White Home Might Drop Crypto Invoice After Coinbase Withdrawal: Report

January 17, 2026
Jefferies’ Drops Bitcoin Over Quantum Computing Menace

Jefferies’ Drops Bitcoin Over Quantum Computing Menace

January 17, 2026
Professional insights on constructing a risk-aligned compliance roadmap for 2026

Professional insights on constructing a risk-aligned compliance roadmap for 2026

January 17, 2026

CoinInight

Welcome to CoinInsight.co.uk – your trusted source for all things cryptocurrency! We are passionate about educating and informing our audience on the rapidly evolving world of digital assets, blockchain technology, and the future of finance.

Categories

  • Bitcoin
  • Blockchain
  • Crypto Mining
  • Ethereum
  • Future of Crypto
  • Market
  • Regulation
  • Ripple

Recent News

Ripple CEO Feedback On Newest CPI Information – Right here’s What He Mentioned

Ripple CEO Feedback On Newest CPI Information – Right here’s What He Mentioned

January 17, 2026
White Home Might Drop Crypto Invoice After Coinbase Withdrawal: Report

White Home Might Drop Crypto Invoice After Coinbase Withdrawal: Report

January 17, 2026
  • About
  • Privacy Poilicy
  • Disclaimer
  • Contact

© 2025- https://coininsight.co.uk/ - All Rights Reserved

No Result
View All Result
  • Home
  • Bitcoin
  • Ethereum
  • Regulation
  • Market
  • Blockchain
  • Ripple
  • Future of Crypto
  • Crypto Mining

© 2025- https://coininsight.co.uk/ - All Rights Reserved

Social Media Auto Publish Powered By : XYZScripts.com
Verified by MonsterInsights