Copy InputIndex into the underlying SignDescriptor struct

When the InputIndex is not 0, the index is not currently copied into the
underlying SignDescriptor structure and the siganture generated is not
valid.
This commit is contained in:
Yaacov Akiba Slama 2020-02-09 10:55:50 +02:00
parent 2cd26d7556
commit 90008386d8

@ -373,8 +373,9 @@ func (s *Server) ComputeInputScript(ctx context.Context,
Value: signDesc.Output.Value,
PkScript: signDesc.Output.PkScript,
},
HashType: txscript.SigHashType(signDesc.Sighash),
SigHashes: sigHashCache,
HashType: txscript.SigHashType(signDesc.Sighash),
SigHashes: sigHashCache,
InputIndex: int(signDesc.InputIndex),
})
}