lnrpc: remove blocks_till_open field from PendingChannelsResponse

In this commit, we remove the blocks_till_open from
PendingChannelsResponse as in its current state, the values that are
assigned to this field don’t accurately reflect the naming. This has
caused a good bit of confusion amongst users lately. As a result, we’re
temporarily removing this field until we have proper incremental
notifications within the chain notifier.
This commit is contained in:
Olaoluwa Osuntokun committed 2018-01-08 19:50:17 -08:00
1 parent f50b911ebc
commit fa6354b223
4 files changed
+306 -332

No files matched your search

+3 -11
View File
@@ -1282,11 +1282,6 @@ func (r *rpcServer) PendingChannels(ctx context.Context,
}
}
_, bestHeight, err := r.server.cc.chainIO.GetBestBlock()
if err != nil {
return nil, err
}
rpcsLog.Debugf("[pendingchannels]")
resp := &lnrpc.PendingChannelsResponse{}
@@ -1315,8 +1310,6 @@ func (r *rpcServer) PendingChannels(ctx context.Context,
commitBaseWeight := blockchain.GetTransactionWeight(utx)
commitWeight := commitBaseWeight + lnwallet.WitnessCommitmentTxWeight
targetConfHeight := pendingChan.FundingBroadcastHeight + uint32(pendingChan.NumConfsRequired)
blocksTillOpen := int32(targetConfHeight) - bestHeight
resp.PendingOpenChannels[i] = &lnrpc.PendingChannelsResponse_PendingOpenChannel{
Channel: &lnrpc.PendingChannelsResponse_PendingChannel{
RemoteNodePub: hex.EncodeToString(pub),
@@ -1325,10 +1318,9 @@ func (r *rpcServer) PendingChannels(ctx context.Context,
LocalBalance: int64(localCommitment.LocalBalance.ToSatoshis()),
RemoteBalance: int64(localCommitment.RemoteBalance.ToSatoshis()),
},
CommitWeight: commitWeight,
CommitFee: int64(localCommitment.CommitFee),
FeePerKw: int64(localCommitment.FeePerKw),
BlocksTillOpen: blocksTillOpen,
CommitWeight: commitWeight,
CommitFee: int64(localCommitment.CommitFee),
FeePerKw: int64(localCommitment.FeePerKw),
// TODO(roasbeef): need to track confirmation height
}
}