From 02dd8d23fd1a18c12decf03a22b9c2ca6d2e65e7 Mon Sep 17 00:00:00 2001 From: "Johan T. Halseth" Date: Fri, 6 Mar 2020 16:11:44 +0100 Subject: [PATCH] input/size: remove unused constants Since we never attempt to sweep an HTLC we offered with the preimage on the remote's commitment, we never use the constant AcceptedHtlcSuccessWitnessSize for weight estimation. Similarly, we never timout an HTLC offered by the remote on our own commitment, and don't need the constant OfferedHtlcTimeoutWitnessSize. --- input/size.go | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/input/size.go b/input/size.go index 68fa85e4..b0d28aa2 100644 --- a/input/size.go +++ b/input/size.go @@ -260,19 +260,6 @@ const ( // - witness_script: (accepted_htlc_script) AcceptedHtlcTimeoutWitnessSize = 1 + 1 + 73 + 1 + 1 + AcceptedHtlcScriptSize - // AcceptedHtlcSuccessWitnessSize 322 bytes - // - number_of_witness_elements: 1 byte - // - nil_length: 1 byte - // - sig_alice_length: 1 byte - // - sig_alice: 73 bytes - // - sig_bob_length: 1 byte - // - sig_bob: 73 bytes - // - preimage_length: 1 byte - // - preimage: 32 bytes - // - witness_script_length: 1 byte - // - witness_script (accepted_htlc_script) - AcceptedHtlcSuccessWitnessSize = 1 + 1 + 73 + 1 + 73 + 1 + 32 + 1 + AcceptedHtlcScriptSize - // AcceptedHtlcPenaltyWitnessSize 249 bytes // - number_of_witness_elements: 1 byte // - revocation_sig_length: 1 byte @@ -317,18 +304,6 @@ const ( // - OP_ENDIF: 1 byte OfferedHtlcScriptSize = 3*1 + 20 + 5*1 + 33 + 10*1 + 33 + 5*1 + 20 + 4*1 - // OfferedHtlcTimeoutWitnessSize 285 bytes - // - number_of_witness_elements: 1 byte - // - nil_length: 1 byte - // - sig_alice_length: 1 byte - // - sig_alice: 73 bytes - // - sig_bob_length: 1 byte - // - sig_bob: 73 bytes - // - nil_length: 1 byte - // - witness_script_length: 1 byte - // - witness_script (offered_htlc_script) - OfferedHtlcTimeoutWitnessSize = 1 + 1 + 1 + 73 + 1 + 73 + 1 + 1 + OfferedHtlcScriptSize - // OfferedHtlcSuccessWitnessSize 317 bytes // - number_of_witness_elements: 1 byte // - nil_length: 1 byte