server: Add max value in flight to server
This commit is contained in:
1 parent
01ba4d0b59
commit
474ce4ae25
3 files changed
+7
No files matched your search
@@ -106,6 +106,7 @@ func (c *chanController) OpenChannel(target *btcec.PublicKey,
|
|||||||
private: c.private,
|
private: c.private,
|
||||||
remoteCsvDelay: 0,
|
remoteCsvDelay: 0,
|
||||||
minConfs: c.minConfs,
|
minConfs: c.minConfs,
|
||||||
|
maxValueInFlight: 0,
|
||||||
}
|
}
|
||||||
|
|
||||||
updateStream, errChan := c.server.OpenChannel(req)
|
updateStream, errChan := c.server.OpenChannel(req)
|
||||||
|
|||||||
@@ -1710,6 +1710,7 @@ func (r *rpcServer) parseOpenChannelReq(in *lnrpc.OpenChannelRequest,
|
|||||||
remoteInitialBalance := btcutil.Amount(in.PushSat)
|
remoteInitialBalance := btcutil.Amount(in.PushSat)
|
||||||
minHtlcIn := lnwire.MilliSatoshi(in.MinHtlcMsat)
|
minHtlcIn := lnwire.MilliSatoshi(in.MinHtlcMsat)
|
||||||
remoteCsvDelay := uint16(in.RemoteCsvDelay)
|
remoteCsvDelay := uint16(in.RemoteCsvDelay)
|
||||||
|
maxValue := lnwire.MilliSatoshi(in.MaxValueInFlight)
|
||||||
|
|
||||||
// Ensure that the initial balance of the remote party (if pushing
|
// Ensure that the initial balance of the remote party (if pushing
|
||||||
// satoshis) does not exceed the amount the local party has requested
|
// satoshis) does not exceed the amount the local party has requested
|
||||||
@@ -1822,6 +1823,7 @@ func (r *rpcServer) parseOpenChannelReq(in *lnrpc.OpenChannelRequest,
|
|||||||
remoteCsvDelay: remoteCsvDelay,
|
remoteCsvDelay: remoteCsvDelay,
|
||||||
minConfs: minConfs,
|
minConfs: minConfs,
|
||||||
shutdownScript: script,
|
shutdownScript: script,
|
||||||
|
maxValueInFlight: maxValue,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3179,6 +3179,10 @@ type openChanReq struct {
|
|||||||
// This value is optional, so may be nil.
|
// This value is optional, so may be nil.
|
||||||
shutdownScript lnwire.DeliveryAddress
|
shutdownScript lnwire.DeliveryAddress
|
||||||
|
|
||||||
|
// maxValueInFlight is the maximum amount of coins in millisatoshi that can
|
||||||
|
// be pending within the channel. It only applies to the remote party.
|
||||||
|
maxValueInFlight lnwire.MilliSatoshi
|
||||||
|
|
||||||
// TODO(roasbeef): add ability to specify channel constraints as well
|
// TODO(roasbeef): add ability to specify channel constraints as well
|
||||||
|
|
||||||
// chanFunder is an optional channel funder that allows the caller to
|
// chanFunder is an optional channel funder that allows the caller to
|
||||||
|
|||||||
Reference in new issue
Block a user