multi: return input.Signature from SignOutputRaw

This commit is contained in:
Conner Fromknecht
2020-04-05 17:06:38 -07:00
parent 37dffb225a
commit 0f94b8dc62
29 changed files with 168 additions and 110 deletions

View File

@@ -410,6 +410,14 @@ const (
OfferedHtlcPenaltyWitnessSize = 1 + 1 + 73 + 1 + 33 + 1 + OfferedHtlcScriptSize
)
type dummySignature struct{}
func (d *dummySignature) Serialize() []byte {
// Always return worst-case signature length, excluding the one byte
// sighash flag.
return make([]byte, 73-1)
}
// dummySigner is a fake signer used for size (upper bound) calculations.
type dummySigner struct {
Signer
@@ -417,12 +425,10 @@ type dummySigner struct {
// SignOutputRaw generates a signature for the passed transaction according to
// the data within the passed SignDescriptor.
func (s *dummySigner) SignOutputRaw(tx *wire.MsgTx, signDesc *SignDescriptor) (
[]byte, error) {
func (s *dummySigner) SignOutputRaw(tx *wire.MsgTx,
signDesc *SignDescriptor) (Signature, error) {
// Always return worst-case signature length, excluding the one byte
// sighash flag.
return make([]byte, 73-1), nil
return &dummySignature{}, nil
}
var (