mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 23:54:22 +01:00
mfc: use declared constants
reduce, reuse, recycle for a greener world
This commit is contained in:
@@ -886,13 +886,10 @@ perform_fundpsbt(struct multifundchannel_command *mfc)
|
|||||||
* inputs, that estimation should be correct.
|
* inputs, that estimation should be correct.
|
||||||
*/
|
*/
|
||||||
startweight = bitcoin_tx_core_weight(1, num_outs)
|
startweight = bitcoin_tx_core_weight(1, num_outs)
|
||||||
+ ( bitcoin_tx_output_weight( 1 /* OP_0 */
|
+ ( bitcoin_tx_output_weight(
|
||||||
+ 1 /* OP_PUSHDATA */
|
BITCOIN_SCRIPTPUBKEY_P2WSH_LEN)
|
||||||
+ 32 /* P2WSH */
|
|
||||||
)
|
|
||||||
* num_outs
|
* num_outs
|
||||||
)
|
);
|
||||||
;
|
|
||||||
json_add_string(req->js, "startweight",
|
json_add_string(req->js, "startweight",
|
||||||
tal_fmt(tmpctx, "%zu", startweight));
|
tal_fmt(tmpctx, "%zu", startweight));
|
||||||
}
|
}
|
||||||
@@ -1023,10 +1020,8 @@ handle_mfc_change(struct multifundchannel_command *mfc)
|
|||||||
* Get the weight of a change output and how much it
|
* Get the weight of a change output and how much it
|
||||||
* costs.
|
* costs.
|
||||||
*/
|
*/
|
||||||
change_weight = bitcoin_tx_output_weight( 1 /* OP_0 */
|
change_weight = bitcoin_tx_output_weight(
|
||||||
+ 1 /* OP_PUSHDATA */
|
BITCOIN_SCRIPTPUBKEY_P2WPKH_LEN);
|
||||||
+ 20 /* P2WPKH */
|
|
||||||
);
|
|
||||||
change_fee = amount_tx_fee(mfc->feerate_per_kw, change_weight);
|
change_fee = amount_tx_fee(mfc->feerate_per_kw, change_weight);
|
||||||
/* The limit is equal to the change_fee plus the dust limit. */
|
/* The limit is equal to the change_fee plus the dust limit. */
|
||||||
if (!amount_sat_add(&change_min_limit,
|
if (!amount_sat_add(&change_min_limit,
|
||||||
|
|||||||
Reference in New Issue
Block a user