core: fix CalculateNetworkFee for signature contracts
First PUSHDATA1 is from invocation script, the second PUSHDATA1 is from verification script. E.g.: Invocation script: INDEX OPCODE PARAMETER 0 PUSHDATA1 035913b9588da23a5c3ce14b2886a6b8ebb6a0eb92bdaa948510dfb5ae5194d6cb << 35 PUSHNULL 36 SYSCALL Neo.Crypto.VerifyWithECDsaSecp256r1 (95440d78) Verification script: INDEX OPCODE PARAMETER 0 PUSHDATA1 3930fe5a9b44682f37741955df4a5f2585ed5aa438fa6e17ae51083673b1d64253e5a859c0cf168be67971e53a23c1c40582777d94a8e391db23ff613849627d <<
This commit is contained in:
parent
230352d99f
commit
2b11e99225
2 changed files with 44 additions and 7 deletions
|
@ -138,7 +138,7 @@ func CalculateNetworkFee(script []byte) (int64, int) {
|
|||
)
|
||||
if vm.IsSignatureContract(script) {
|
||||
size += 67 + io.GetVarSize(script)
|
||||
netFee += opcodePrice(opcode.PUSHDATA1, opcode.PUSHNULL) + crypto.ECDSAVerifyPrice
|
||||
netFee += opcodePrice(opcode.PUSHDATA1, opcode.PUSHNULL, opcode.PUSHDATA1) + crypto.ECDSAVerifyPrice
|
||||
} else if m, pubs, ok := vm.ParseMultiSigContract(script); ok {
|
||||
n := len(pubs)
|
||||
sizeInv := 66 * m
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue