forked from TrueCloudLab/neoneo-go
parent
f60fa02a96
commit
8005bfcd32
1 changed files with 6 additions and 1 deletions
|
@ -6,6 +6,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"math/big"
|
"math/big"
|
||||||
"strings"
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/nspcc-dev/neo-go/cli/cmdargs"
|
"github.com/nspcc-dev/neo-go/cli/cmdargs"
|
||||||
"github.com/nspcc-dev/neo-go/cli/flags"
|
"github.com/nspcc-dev/neo-go/cli/flags"
|
||||||
|
@ -687,17 +688,21 @@ func signAndSendSomeTransaction(ctx *cli.Context, act *actor.Actor, acc *wallet.
|
||||||
tx.SystemFee += int64(sysgas)
|
tx.SystemFee += int64(sysgas)
|
||||||
tx.NetworkFee += int64(gas)
|
tx.NetworkFee += int64(gas)
|
||||||
|
|
||||||
|
ver := act.GetVersion()
|
||||||
if outFile := ctx.String("out"); outFile != "" {
|
if outFile := ctx.String("out"); outFile != "" {
|
||||||
ver := act.GetVersion()
|
|
||||||
// Make a long-lived transaction, it's to be signed manually.
|
// Make a long-lived transaction, it's to be signed manually.
|
||||||
tx.ValidUntilBlock += (ver.Protocol.MaxValidUntilBlockIncrement - uint32(ver.Protocol.ValidatorsCount)) - 2
|
tx.ValidUntilBlock += (ver.Protocol.MaxValidUntilBlockIncrement - uint32(ver.Protocol.ValidatorsCount)) - 2
|
||||||
err = paramcontext.InitAndSave(ver.Protocol.Network, tx, acc, outFile)
|
err = paramcontext.InitAndSave(ver.Protocol.Network, tx, acc, outFile)
|
||||||
} else {
|
} else {
|
||||||
if !ctx.Bool("force") {
|
if !ctx.Bool("force") {
|
||||||
|
promptTime := time.Now()
|
||||||
err := input.ConfirmTx(ctx.App.Writer, tx)
|
err := input.ConfirmTx(ctx.App.Writer, tx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return cli.NewExitError(err, 1)
|
return cli.NewExitError(err, 1)
|
||||||
}
|
}
|
||||||
|
waitTime := time.Since(promptTime)
|
||||||
|
// Compensate for confirmation waiting.
|
||||||
|
tx.ValidUntilBlock += uint32((waitTime.Milliseconds() / int64(ver.Protocol.MillisecondsPerBlock))) + 1
|
||||||
}
|
}
|
||||||
_, _, err = act.SignAndSend(tx)
|
_, _, err = act.SignAndSend(tx)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue