Merge pull request #840 from halseth/openchannel-csv-delay

Add CSV delay flag to openchannel
This commit is contained in:
Olaoluwa Osuntokun
2018-03-31 16:05:08 -07:00
committed by GitHub
8 changed files with 404 additions and 362 deletions

View File

@@ -711,6 +711,7 @@ func (r *rpcServer) OpenChannel(in *lnrpc.OpenChannelRequest,
localFundingAmt := btcutil.Amount(in.LocalFundingAmount)
remoteInitialBalance := btcutil.Amount(in.PushSat)
minHtlc := lnwire.MilliSatoshi(in.MinHtlcMsat)
remoteCsvDelay := uint16(in.RemoteCsvDelay)
// Ensure that the initial balance of the remote party (if pushing
// satoshis) does not exceed the amount the local party has requested
@@ -784,7 +785,7 @@ func (r *rpcServer) OpenChannel(in *lnrpc.OpenChannelRequest,
updateChan, errChan := r.server.OpenChannel(
nodePubKey, localFundingAmt,
lnwire.NewMSatFromSatoshis(remoteInitialBalance),
minHtlc, feeRate, in.Private,
minHtlc, feeRate, in.Private, remoteCsvDelay,
)
var outpoint wire.OutPoint
@@ -879,6 +880,7 @@ func (r *rpcServer) OpenChannelSync(ctx context.Context,
localFundingAmt := btcutil.Amount(in.LocalFundingAmount)
remoteInitialBalance := btcutil.Amount(in.PushSat)
minHtlc := lnwire.MilliSatoshi(in.MinHtlcMsat)
remoteCsvDelay := uint16(in.RemoteCsvDelay)
// Ensure that the initial balance of the remote party (if pushing
// satoshis) does not exceed the amount the local party has requested
@@ -911,7 +913,7 @@ func (r *rpcServer) OpenChannelSync(ctx context.Context,
updateChan, errChan := r.server.OpenChannel(
nodepubKey, localFundingAmt,
lnwire.NewMSatFromSatoshis(remoteInitialBalance),
minHtlc, feeRate, in.Private,
minHtlc, feeRate, in.Private, remoteCsvDelay,
)
select {