cli: use MVUBI for saved transactions

And DO NOT CHANGE TX in paramcontext InitAndSave, because it's really
unobvious and must not be done this way.
This commit is contained in:
Roman Khimov 2022-08-07 22:08:13 +03:00
parent ba2e7063dd
commit d9feec2be5
4 changed files with 14 additions and 5 deletions

View file

@ -12,14 +12,9 @@ import (
"github.com/nspcc-dev/neo-go/pkg/wallet"
)
// validUntilBlockIncrement is the number of extra blocks to add to an exported transaction.
const validUntilBlockIncrement = 50
// InitAndSave creates an incompletely signed transaction which can be used
// as an input to `multisig sign`.
func InitAndSave(net netmode.Magic, tx *transaction.Transaction, acc *wallet.Account, filename string) error {
// avoid fast transaction expiration
tx.ValidUntilBlock += validUntilBlockIncrement
priv := acc.PrivateKey()
pub := priv.PublicKey()
sign := priv.SignHashable(uint32(net), tx)