forked from TrueCloudLab/neoneo-go
cli: fix canceltx ValidUntilBlock parameter of conflicting transaction
If main transaction is known, then conflicting transaction shouldn't be valid longer than the main one. Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
This commit is contained in:
parent
4c6dca876c
commit
4f5e3f363a
2 changed files with 13 additions and 10 deletions
|
@ -64,6 +64,9 @@ func cancelTx(ctx *cli.Context) error {
|
|||
t.NetworkFee = mainTx.NetworkFee + 1
|
||||
}
|
||||
t.NetworkFee += int64(flags.Fixed8FromContext(ctx, "gas"))
|
||||
if mainTx != nil {
|
||||
t.ValidUntilBlock = mainTx.ValidUntilBlock
|
||||
}
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
|
|
|
@ -61,11 +61,11 @@ be the transaction hash. If another account is not specified, the conflicting tr
|
|||
automatically generated and signed by the default account in the wallet. If the target transaction
|
||||
is in the memory pool of the provided RPC node, the NetworkFee value of the conflicting transaction
|
||||
is set to the target transaction's NetworkFee value plus one (if it's sufficient for the
|
||||
conflicting transaction itself). If the target transaction is not in the memory pool, standard
|
||||
conflicting transaction itself), the ValidUntilBlock value of the conflicting transaction is set to the
|
||||
target transaction's ValidUntilBlock value. If the target transaction is not in the memory pool, standard
|
||||
NetworkFee calculations are performed based on the calculatenetworkfee RPC request. If the --gas
|
||||
flag is included, the specified value is added to the resulting conflicting transaction network fee
|
||||
in both scenarios.
|
||||
`,
|
||||
in both scenarios.`,
|
||||
Action: cancelTx,
|
||||
Flags: txCancelFlags,
|
||||
},
|
||||
|
|
Loading…
Add table
Reference in a new issue