Migrate sat_per_byte to sat_per_vbyte for LND requests

Per LND v0.21.0 release notes, the sat_per_byte option will be removed
in v0.22 across CloseChannel, OpenChannel, SendCoins, SendMany, and
walletrpc.BumpFee. LND already treats sat_per_byte as sat/vbyte
internally, so this is a pure rename with no value conversion. Updates
both the wire-format strings sent to LND and the matching TypeScript
identifiers across the close-channel, open-channel, send-coins, and
bump-fee paths.
This commit is contained in:
saubyk 2026-05-05 18:13:08 -07:00 committed by Suheb
parent 890db72ab6
commit 6e48241d85
18 changed files with 34 additions and 25 deletions

View file

@ -139,7 +139,7 @@ export const postChannel = (req, res, next) => {
if (trans_type === '1') {
options.form.target_conf = trans_type_value;
} else if (trans_type === '2') {
options.form.sat_per_byte = trans_type_value;
options.form.sat_per_vbyte = trans_type_value;
}
if (commitment_type) {
options.form.commitment_type = commitment_type;
@ -167,7 +167,7 @@ export const closeChannel = (req, res, next) => {
const channelpoint = req.params.channelPoint?.replace(':', '/');
options.url = req.session.selectedNode.settings.lnServerUrl + '/v1/channels/' + channelpoint + '?force=' + req.query.force;
if (req.query.target_conf) { options.url = options.url + '&target_conf=' + req.query.target_conf; }
if (req.query.sat_per_byte) { options.url = options.url + '&sat_per_byte=' + req.query.sat_per_byte; }
if (req.query.sat_per_vbyte) { options.url = options.url + '&sat_per_vbyte=' + req.query.sat_per_vbyte; }
logger.log({ selectedNode: req.session.selectedNode, level: 'DEBUG', fileName: 'Channels', msg: 'Closing Channel Options URL', data: options.url });
request.delete(options);
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Channels', msg: 'Channel Close Requested' });

View file

@ -28,7 +28,7 @@ export const postTransactions = (req, res, next) => {
options.form = {
amount: amount,
addr: address,
sat_per_byte: fees,
sat_per_vbyte: fees,
target_conf: blocks
};
if (sendAll) { options.form.send_all = sendAll; }

View file

@ -110,7 +110,7 @@ export const getUTXOs = (req, res, next) => {
};
export const bumpFee = (req, res, next) => {
const { txid, outputIndex, targetConf, satPerByte } = req.body;
const { txid, outputIndex, targetConf, satPerVByte } = req.body;
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Wallet', msg: 'Bumping Fee..' });
options = common.getOptions(req);
if (options.error) { return res.status(options.statusCode).json({ message: options.message, error: options.error }); }
@ -122,8 +122,8 @@ export const bumpFee = (req, res, next) => {
};
if (targetConf) {
options.form.target_conf = targetConf;
} else if (satPerByte) {
options.form.sat_per_byte = satPerByte;
} else if (satPerVByte) {
options.form.sat_per_vbyte = satPerVByte;
}
options.form = JSON.stringify(options.form);
request.post(options).then((body) => {