peer+rpc: set new rbf coop close rbf update fields

This commit is contained in:
Olaoluwa Osuntokun committed 2025-03-18 11:44:20 -05:00
1 parent b32f576aeb
commit 81d34c4ac2
2 files changed
+53 -8

No files matched your search

+17 -4
View File
@@ -2912,6 +2912,7 @@ func (r *rpcServer) CloseChannel(in *lnrpc.CloseChannelRequest,
return err
}
}
out:
for {
select {
@@ -2957,6 +2958,7 @@ out:
h, _ := chainhash.NewHash(closeUpdate.ClosingTxid)
rpcsLog.Infof("[closechannel] close completed: "+
"txid(%v)", h)
break out
}
@@ -3047,12 +3049,23 @@ func createRPCCloseUpdate(
}, nil
case *peer.PendingUpdate:
upd := &lnrpc.PendingUpdate{
Txid: u.Txid,
OutputIndex: u.OutputIndex,
}
// Potentially set the optional fields that are only set for
// the new RBF close flow.
u.IsLocalCloseTx.WhenSome(func(isLocal bool) {
upd.LocalCloseTx = isLocal
})
u.FeePerVbyte.WhenSome(func(feeRate chainfee.SatPerVByte) {
upd.FeePerVbyte = int64(feeRate)
})
return &lnrpc.CloseStatusUpdate{
Update: &lnrpc.CloseStatusUpdate_ClosePending{
ClosePending: &lnrpc.PendingUpdate{
Txid: u.Txid,
OutputIndex: u.OutputIndex,
},
ClosePending: upd,
},
}, nil
}