BlueWallet / HelloLightning

Lightning Network node
MIT License
10 stars 2 forks source link

Transaction generation on Event.FundingGenerationReady evennt #2

Closed konak closed 2 years ago

konak commented 2 years ago

Hi !

I were reviewing code and got a question on Event.FundingGenerationReady event. In your code you do not generate a transaction. But analyzing the same event in sample node implementation in Rust https://github.com/lightningdevkit/ldk-sample/blob/main/src/main.rs shows that transaction should be generated and passed into the channel_manager?.funding_transaction_generated. The same is written in documentation of Rust version: https://docs.rs/lightning/0.0.105/lightning/util/events/enum.Event.html

Used to indicate that the client should generate a funding transaction with the given parameters and then call [ChannelManager::funding_transaction_generated](https://docs.rs/lightning/0.0.105/lightning/ln/channelmanager/struct.ChannelManager.html#method.funding_transaction_generated). Generated in [ChannelManager](https://docs.rs/lightning/0.0.105/lightning/ln/channelmanager/struct.ChannelManager.html) message handling. Note that all inputs in the funding transaction must spend SegWit outputs or your counterparty can steal your funds!

are you sure you do not need that transaction generation ?

Overtorment commented 2 years ago

there is no transaction in code of HelloLightning because its assumed that transaction is generated somewhere else, and then passed to step2