* modify multi sign result for same password
* optimise
* fix unit test
log.WithField("err", err).Warningf("computing signature %d", i)
continue
}
+
+ // This break is ordered to avoid signing transaction successfully only once for a multiple-sign account
+ // that consist of different keys by the same password. Exit immediately when the signature is success,
+ // it means that only one signature will be successful in the loop for this multiple-sign account.
sw.Sigs[i] = sigBytes
+ break
}
return nil
}
log.WithField("err", err).Warningf("computing signature %d", i)
continue
}
+
+ // This break is ordered to avoid signing transaction successfully only once for a multiple-sign account
+ // that consist of different keys by the same password. Exit immediately when the signature is success,
+ // it means that only one signature will be successful in the loop for this multiple-sign account.
sw.Sigs[i] = sigBytes
+ break
}
return nil
}
t.Fatal(err)
}
+ // the number of sign transaction is equal to the count of xpub for account
+ if _, err := test.MockSign(tpl, hsm, "password"); err != nil {
+ t.Fatal(err)
+ }
if _, err := test.MockSign(tpl, hsm, "password"); err != nil {
t.Fatal(err)
}