multi: formatting and comment fixes

This commit is contained in:
Oliver Gugger committed 2022-02-10 11:02:02 +01:00
1 parent ffee7d1bcf
commit 895a2e497b
160 files changed
+159 -260

No files matched your search

+2 -1
View File
@@ -381,6 +381,7 @@ func IsHtlcSpendRevoke(txIn *wire.TxIn, signDesc *SignDescriptor) (
if len(txIn.Witness) == 3 &&
bytes.Equal(txIn.Witness[1], revokeKey.SerializeCompressed()) {
return true, nil
}
@@ -798,7 +799,7 @@ func SecondLevelHtlcScript(revocationKey, delayKey *btcec.PublicKey,
// OP_DROP
// <delay key>
// OP_ENDIF
// OP_CHECKSIG
// OP_CHECKSIG.
func LeaseSecondLevelHtlcScript(revocationKey, delayKey *btcec.PublicKey,
csvDelay, cltvExpiry uint32) ([]byte, error) {
+1
View File
@@ -22,6 +22,7 @@ import (
// prints debug information to stdout.
func assertEngineExecution(t *testing.T, testNum int, valid bool,
newEngine func() (*txscript.Engine, error)) {
t.Helper()
// Get a new VM to execute.
+12 -12
View File
@@ -47,7 +47,7 @@ const (
// - max-size: 40 bytes
UnknownWitnessSize = 1 + 1 + 40
// P2PKHSize 25 bytes
// P2PKHSize 25 bytes.
P2PKHSize = 25
// P2PKHOutputSize 34 bytes
@@ -68,7 +68,7 @@ const (
// - pkscript (p2wsh): 34 bytes
P2WSHOutputSize = 8 + 1 + P2WSHSize
// P2SHSize 23 bytes
// P2SHSize 23 bytes.
P2SHSize = 23
// P2SHOutputSize 32 bytes
@@ -205,16 +205,16 @@ const (
BaseAnchorCommitmentTxSize = 4 + 1 + FundingInputSize + 3 +
2*CommitmentDelayOutput + 2*CommitmentAnchorOutput + 4
// BaseAnchorCommitmentTxWeight 900 weight
// BaseAnchorCommitmentTxWeight 900 weight.
BaseAnchorCommitmentTxWeight = witnessScaleFactor * BaseAnchorCommitmentTxSize
// CommitWeight 724 weight
// CommitWeight 724 weight.
CommitWeight = BaseCommitmentTxWeight + WitnessCommitmentTxWeight
// AnchorCommitWeight 1124 weight
// AnchorCommitWeight 1124 weight.
AnchorCommitWeight = BaseAnchorCommitmentTxWeight + WitnessCommitmentTxWeight
// HTLCWeight 172 weight
// HTLCWeight 172 weight.
HTLCWeight = witnessScaleFactor * HTLCSize
// HtlcTimeoutWeight 663 weight
@@ -358,7 +358,7 @@ const (
AcceptedHtlcScriptSize = 3*1 + 20 + 5*1 + 33 + 8*1 + 20 + 4*1 +
33 + 5*1 + 4 + 5*1
// AcceptedHtlcScriptSizeConfirmed 143 bytes
// AcceptedHtlcScriptSizeConfirmed 143 bytes.
AcceptedHtlcScriptSizeConfirmed = AcceptedHtlcScriptSize +
HtlcConfirmedScriptOverhead
@@ -371,7 +371,7 @@ const (
// - witness_script: (accepted_htlc_script)
AcceptedHtlcTimeoutWitnessSize = 1 + 1 + 73 + 1 + 1 + AcceptedHtlcScriptSize
// AcceptedHtlcTimeoutWitnessSizeConfirmed 220 bytes
// AcceptedHtlcTimeoutWitnessSizeConfirmed 220 bytes.
AcceptedHtlcTimeoutWitnessSizeConfirmed = 1 + 1 + 73 + 1 + 1 +
AcceptedHtlcScriptSizeConfirmed
@@ -385,7 +385,7 @@ const (
// - witness_script (accepted_htlc_script)
AcceptedHtlcPenaltyWitnessSize = 1 + 1 + 73 + 1 + 33 + 1 + AcceptedHtlcScriptSize
// AcceptedHtlcPenaltyWitnessSizeConfirmed 253 bytes
// AcceptedHtlcPenaltyWitnessSizeConfirmed 253 bytes.
AcceptedHtlcPenaltyWitnessSizeConfirmed = 1 + 1 + 73 + 1 + 33 + 1 +
AcceptedHtlcScriptSizeConfirmed
@@ -448,7 +448,7 @@ const (
// - OP_ENDIF: 1 byte
OfferedHtlcScriptSize = 3*1 + 20 + 5*1 + 33 + 10*1 + 33 + 5*1 + 20 + 4*1
// OfferedHtlcScriptSizeConfirmed 136 bytes
// OfferedHtlcScriptSizeConfirmed 136 bytes.
OfferedHtlcScriptSizeConfirmed = OfferedHtlcScriptSize +
HtlcConfirmedScriptOverhead
@@ -462,7 +462,7 @@ const (
// - witness_script (offered_htlc_script)
OfferedHtlcSuccessWitnessSize = 1 + 1 + 73 + 1 + 32 + 1 + OfferedHtlcScriptSize
// OfferedHtlcSuccessWitnessSizeConfirmed 245 bytes
// OfferedHtlcSuccessWitnessSizeConfirmed 245 bytes.
OfferedHtlcSuccessWitnessSizeConfirmed = 1 + 1 + 73 + 1 + 32 + 1 +
OfferedHtlcScriptSizeConfirmed
@@ -497,7 +497,7 @@ const (
// - witness_script (offered_htlc_script)
OfferedHtlcPenaltyWitnessSize = 1 + 1 + 73 + 1 + 33 + 1 + OfferedHtlcScriptSize
// OfferedHtlcPenaltyWitnessSizeConfirmed 246 bytes
// OfferedHtlcPenaltyWitnessSizeConfirmed 246 bytes.
OfferedHtlcPenaltyWitnessSizeConfirmed = 1 + 1 + 73 + 1 + 33 + 1 +
OfferedHtlcScriptSizeConfirmed
-1
View File
@@ -938,7 +938,6 @@ func genSuccessTx(chanType channeldb.ChannelType) (*wire.MsgTx, error) {
successTx.TxIn[0].Witness = successWitness
return successTx, nil
}
type txSizeTest struct {
-1
View File
@@ -405,7 +405,6 @@ func (wt StandardWitnessType) WitnessGenerator(signer Signer,
// NOTE: This is part of the WitnessType interface.
func (wt StandardWitnessType) SizeUpperBound() (int, bool, error) {
switch wt {
// Outputs on a remote commitment transaction that pay directly to us.
case CommitSpendNoDelayTweakless:
fallthrough