@@ -63,11 +63,11 @@ type HtlcScript interface {
6363
6464 // MaxSuccessWitnessSize returns the maximum witness size for the
6565 // success case witness.
66- MaxSuccessWitnessSize () int
66+ MaxSuccessWitnessSize () lntypes. WeightUnit
6767
6868 // MaxTimeoutWitnessSize returns the maximum witness size for the
6969 // timeout case witness.
70- MaxTimeoutWitnessSize () int
70+ MaxTimeoutWitnessSize () lntypes. WeightUnit
7171
7272 // TimeoutScript returns the redeem script required to unlock the htlc
7373 // after timeout.
@@ -436,7 +436,7 @@ func (h *HtlcScriptV2) SuccessScript() []byte {
436436}
437437
438438// MaxSuccessWitnessSize returns maximum success witness size.
439- func (h * HtlcScriptV2 ) MaxSuccessWitnessSize () int {
439+ func (h * HtlcScriptV2 ) MaxSuccessWitnessSize () lntypes. WeightUnit {
440440 // Calculate maximum success witness size
441441 //
442442 // - number_of_witness_elements: 1 byte
@@ -446,11 +446,11 @@ func (h *HtlcScriptV2) MaxSuccessWitnessSize() int {
446446 // - preimage: 32 bytes
447447 // - witness_script_length: 1 byte
448448 // - witness_script: len(script) bytes
449- return 1 + 1 + 73 + 1 + 32 + 1 + len (h .script )
449+ return lntypes . WeightUnit ( 1 + 1 + 73 + 1 + 32 + 1 + len (h .script ) )
450450}
451451
452452// MaxTimeoutWitnessSize returns maximum timeout witness size.
453- func (h * HtlcScriptV2 ) MaxTimeoutWitnessSize () int {
453+ func (h * HtlcScriptV2 ) MaxTimeoutWitnessSize () lntypes. WeightUnit {
454454 // Calculate maximum timeout witness size
455455 //
456456 // - number_of_witness_elements: 1 byte
@@ -461,7 +461,7 @@ func (h *HtlcScriptV2) MaxTimeoutWitnessSize() int {
461461 // - zero: 1 byte
462462 // - witness_script_length: 1 byte
463463 // - witness_script: len(script) bytes
464- return 1 + 1 + 73 + 1 + 33 + 1 + 1 + len (h .script )
464+ return lntypes . WeightUnit ( 1 + 1 + 73 + 1 + 33 + 1 + 1 + len (h .script ) )
465465}
466466
467467// SuccessSequence returns the sequence to spend this htlc in the success case.
@@ -735,7 +735,7 @@ func (h *HtlcScriptV3) SuccessScript() []byte {
735735
736736// MaxSuccessWitnessSize returns the maximum witness size for the
737737// success case witness.
738- func (h * HtlcScriptV3 ) MaxSuccessWitnessSize () int {
738+ func (h * HtlcScriptV3 ) MaxSuccessWitnessSize () lntypes. WeightUnit {
739739 // Calculate maximum success witness size
740740 //
741741 // - number_of_witness_elements: 1 byte
@@ -755,7 +755,7 @@ func (h *HtlcScriptV3) MaxSuccessWitnessSize() int {
755755
756756// MaxTimeoutWitnessSize returns the maximum witness size for the
757757// timeout case witness.
758- func (h * HtlcScriptV3 ) MaxTimeoutWitnessSize () int {
758+ func (h * HtlcScriptV3 ) MaxTimeoutWitnessSize () lntypes. WeightUnit {
759759 // Calculate maximum timeout witness size
760760 //
761761 // - number_of_witness_elements: 1 byte
@@ -768,7 +768,7 @@ func (h *HtlcScriptV3) MaxTimeoutWitnessSize() int {
768768 // - leafVersionAndParity: 1
769769 // - internalPubkey: 32
770770 // - proof: 32
771- return 1 + 1 + 64 + 1 + 36 + 1 + 65
771+ return lntypes . WeightUnit ( 1 + 1 + 64 + 1 + 36 + 1 + 65 )
772772}
773773
774774// SuccessSequence returns the sequence to spend this htlc in the
0 commit comments