You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The txprepare function in Core Lightning does not seem to respect the feerate argument provided by the user. Instead of constructing the transaction with the specified feerate, it appears to apply some internal logic that results in a different feerate being used.
Additionally, the documentation for txprepare lacks clarity regarding the feerate parameter. It does not specify:
-The expected format or units for the feerate argument
-Whether alternative feerate options (besides "normal") are supported
-How txprepare processes the provided feerate and why the resulting transaction feerate differs from the input
Steps to Reproduce:
Call txprepare with a specific feerate, e.g.:
lightning-cli txprepare ["outputs"] ["feerate"]
Inspect the resulting transaction's actual feerate.
Compare the expected feerate with the actual feerate applied by Core Lightning.
Expected Behavior:
The transaction should be created with the feerate explicitly passed to txprepare.
Actual Behavior:
The resulting transaction has a different feerate from the one provided.
Additional Information:
-Core Lightning version: v25.02
-Logs and output from txprepare:
It seems the feerate parameter is not well documented. lightningd/feerate.c parses the feerate parameters as one of the following strings:
"slow", "normal", "urgent", "minimum" which are relevant for txprepare, besides other cases
"opening", "mutual_close", "penalty", "unilateral_close", "unilateral_anchor_close" that are specific
for internal purposes.
It can also be input as a number of blocks, eg. "Xblocks" where "X" is an integer.
And it can be input as a number of sats per unit of kweight "Xperkw",
or sats per kbytes "Xperkb", where "X" is an integer.
If no unit is specified, the "perkb" is assumed.
The
txprepare
function in Core Lightning does not seem to respect thefeerate
argument provided by the user. Instead of constructing the transaction with the specified feerate, it appears to apply some internal logic that results in a different feerate being used.Additionally, the documentation for
txprepare
lacks clarity regarding thefeerate
parameter. It does not specify:-The expected format or units for the
feerate
argument-Whether alternative feerate options (besides
"normal"
) are supported-How
txprepare
processes the provided feerate and why the resulting transaction feerate differs from the inputSteps to Reproduce:
txprepare
with a specificfeerate
, e.g.:Expected Behavior:
The transaction should be created with the feerate explicitly passed to
txprepare
.Actual Behavior:
The resulting transaction has a different feerate from the one provided.
Additional Information:
-Core Lightning version: v25.02
-Logs and output from txprepare:
Notice in this example we passed in 4000 for the feerate but the resulting transaction has a feerate of 4288. (609sats /142vbytes).
Just to confirm my suspicions because the psbt was not signed, I signed the psbt and analyzed that and it has the same feerate:
Again, 609 sats / 142 vbytes = 4288 feerate
Would appreciate any clarification on how txprepare handles the feerate argument and whether this is an intended behavior or a bug.
The text was updated successfully, but these errors were encountered: