lnrpc+lncli: deprecate sat_per_byte and add sat_per_vbyte

This commit deprecates/replaces the old field `sat_per_byte` with
`sat_per_vbyte`. While the old field suggests sat per byte, it’s
actually using sat per virtual byte. We use the Hidden param to hide all
the deprecated flags. These flags won't show up in help menu onwards,
while stay valid that can be passed from cli. Thus bash scripts
referencing these fields won't be broken.
This commit is contained in:
yyforyongyu committed 2021-03-26 17:16:40 +08:00
1 parent 2466758acd
commit 9d0d88ac21
20 files changed
+1519 -1110

No files matched your search

+14 -4
View File
@@ -370,8 +370,15 @@ func (c *WatchtowerClient) Policy(ctx context.Context,
}
return &PolicyResponse{
MaxUpdates: uint32(policy.MaxUpdates),
SweepSatPerByte: uint32(policy.SweepFeeRate.FeePerKVByte() / 1000),
MaxUpdates: uint32(policy.MaxUpdates),
SweepSatPerVbyte: uint32(
policy.SweepFeeRate.FeePerKVByte() / 1000,
),
// Deprecated field.
SweepSatPerByte: uint32(
policy.SweepFeeRate.FeePerKVByte() / 1000,
),
}, nil
}
@@ -387,12 +394,15 @@ func marshallTower(tower *wtclient.RegisteredTower, includeSessions bool) *Tower
if includeSessions {
rpcSessions = make([]*TowerSession, 0, len(tower.Sessions))
for _, session := range tower.Sessions {
satPerByte := session.Policy.SweepFeeRate.FeePerKVByte() / 1000
satPerVByte := session.Policy.SweepFeeRate.FeePerKVByte() / 1000
rpcSessions = append(rpcSessions, &TowerSession{
NumBackups: uint32(len(session.AckedUpdates)),
NumPendingBackups: uint32(len(session.CommittedUpdates)),
MaxBackups: uint32(session.Policy.MaxUpdates),
SweepSatPerByte: uint32(satPerByte),
SweepSatPerVbyte: uint32(satPerVByte),
// Deprecated field.
SweepSatPerByte: uint32(satPerVByte),
})
}
}