feat: add contract_flags support to redirect refund to accepter#157
Conversation
ec8f65c to
73dfb81
Compare
bennyhodl
left a comment
There was a problem hiding this comment.
One comment, please rebase this to 1 commit
|
Offeror can't originate the redirect flag — only honor an inbound one The accepter side is fully wired: an inbound But there's no path for this node to originate the flag as the offeror. For bi-directional behavior, plumb the flag in through the offer input — e.g. add it to pub struct ContractInput {
pub offer_collateral: Amount,
pub accept_collateral: Amount,
pub fee_rate: u64,
#[serde(default)]
pub contract_flags: u8,
pub contract_infos: Vec<ContractInputInfo>,
}and read it in contract_flags: contract.contract_flags,
Two related notes worth deciding on, even if out of scope here:
|
73dfb81 to
7187600
Compare
7187600 to
735ded0
Compare
|
The force-push
On the two follow-up notes:
|
Summary
Use bit 0 of the existing contract_flags byte on DlcOffer to signal that all refund transaction
proceeds go to the accepter. When the flag is set, the offerer's refund output is Amount::ZERO
(dust-discarded) and the accepter receives total_collateral.
Changes
create_cets_and_refund_tx
create_renewal_channel_transactions)
channel_updater.rs
channel_updater.rs
channel_updater.rs