forked from TrueCloudLab/neoneo-go
Merge pull request #1115 from nspcc-dev/fix/convert
keys: support returning legacy verification script
This commit is contained in:
commit
56a8f11ad6
1 changed files with 6 additions and 0 deletions
|
@ -277,6 +277,12 @@ func (p *PublicKey) EncodeBinary(w *io.BinWriter) {
|
|||
func (p *PublicKey) GetVerificationScript() []byte {
|
||||
b := p.Bytes()
|
||||
buf := io.NewBufBinWriter()
|
||||
if address.Prefix == address.NEO2Prefix {
|
||||
buf.WriteB(0x21) // PUSHBYTES33
|
||||
buf.WriteBytes(p.Bytes())
|
||||
buf.WriteB(0xAC) // CHECKSIG
|
||||
return buf.Bytes()
|
||||
}
|
||||
emit.Bytes(buf.BinWriter, b)
|
||||
emit.Opcode(buf.BinWriter, opcode.PUSHNULL)
|
||||
emit.Syscall(buf.BinWriter, "Neo.Crypto.ECDsaVerify")
|
||||
|
|
Loading…
Reference in a new issue