@@ -50,34 +50,32 @@ func TransferSignatureValidate(c context.Context, ctx *Context) error {
5050 }
5151 ctx .Signatures = append (ctx .Signatures , sigma )
5252 }
53-
54- var isRedeem bool
55- for _ , output := range ctx .TransferAction .Outputs {
56- if output .Owner == nil {
57- isRedeem = true
58- break
59- }
60- }
61-
62- // If transfer action is a redeem, verify the signature of the issuer
63- if isRedeem {
64- ctx .Logger .Infof ("action is a redeem, verify the signature of the issuer" )
65-
66- issuer := ctx .TransferAction .GetIssuer ()
67- if issuer == nil {
68- return errors .Errorf ("On Redeem action, must have at least one issuer" )
69- }
70-
71- issuerVerifier , err := ctx .Deserializer .GetIssuerVerifier (c , issuer )
72- if err != nil {
73- return errors .Wrapf (err , "failed deserializing issuer [%s]" , issuer .UniqueID ())
53+ if len (ctx .PP .Issuers ()) > 0 {
54+ // In this case we must ensure that an issuer signed as well if the action redeems tokens as well
55+ var isRedeem bool
56+ for _ , output := range ctx .TransferAction .Outputs {
57+ if output .Owner == nil {
58+ isRedeem = true
59+ break
60+ }
7461 }
75-
76- sigma , err := ctx .SignatureProvider .HasBeenSignedBy (c , issuer , issuerVerifier )
77- if err != nil {
78- return errors .Wrapf (err , "failed signature verification [%s]" , issuer .UniqueID ())
62+ // If transfer action is a redeem, verify the signature of the issuer
63+ if isRedeem {
64+ ctx .Logger .Infof ("action is a redeem, verify the signature of the issuer" )
65+ issuer := ctx .TransferAction .GetIssuer ()
66+ if issuer == nil {
67+ return errors .Errorf ("On Redeem action, must have at least one issuer" )
68+ }
69+ issuerVerifier , err := ctx .Deserializer .GetIssuerVerifier (c , issuer )
70+ if err != nil {
71+ return errors .Wrapf (err , "failed deserializing issuer [%s]" , issuer .UniqueID ())
72+ }
73+ sigma , err := ctx .SignatureProvider .HasBeenSignedBy (c , issuer , issuerVerifier )
74+ if err != nil {
75+ return errors .Wrapf (err , "failed signature verification [%s]" , issuer .UniqueID ())
76+ }
77+ ctx .Signatures = append (ctx .Signatures , sigma )
7978 }
80- ctx .Signatures = append (ctx .Signatures , sigma )
8179 }
8280
8381 ctx .InputTokens = inputToken
0 commit comments