forked from TrueCloudLab/neoneo-go
core: fix CalculateNetworkFee() for multisig contracts
We return m from the vm.ParseMultiSigContract and n is the length of pubs, invocation script then pushes m signatures for n keys.
This commit is contained in:
parent
afc5ee1ded
commit
3134e364b2
1 changed files with 2 additions and 2 deletions
|
@ -136,8 +136,8 @@ func CalculateNetworkFee(script []byte) (int64, int) {
|
|||
if vm.IsSignatureContract(script) {
|
||||
size += 67 + io.GetVarSize(script)
|
||||
netFee += opcodePrice(opcode.PUSHDATA1, opcode.PUSHNULL) + crypto.ECDSAVerifyPrice
|
||||
} else if n, pubs, ok := vm.ParseMultiSigContract(script); ok {
|
||||
m := len(pubs)
|
||||
} else if m, pubs, ok := vm.ParseMultiSigContract(script); ok {
|
||||
n := len(pubs)
|
||||
sizeInv := 66 * m
|
||||
size += io.GetVarSize(sizeInv) + sizeInv + io.GetVarSize(script)
|
||||
netFee += calculateMultisigFee(m) + calculateMultisigFee(n)
|
||||
|
|
Loading…
Reference in a new issue