mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-07-28 13:52:55 +02:00
peer+rpc: set new rbf coop close rbf update fields
This commit is contained in:
21
rpcserver.go
21
rpcserver.go
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user