Fix auto-sequencing (closes #950)

This commit is contained in:
Christopher Goes 2018-05-03 18:35:12 +02:00
parent f38a1f8f41
commit 4911db850d
No known key found for this signature in database
GPG Key ID: E828D98232D328D3
1 changed files with 3 additions and 2 deletions

View File

@ -36,7 +36,7 @@ func NewCoreContextFromViper() CoreContext {
Sequence: viper.GetInt64(client.FlagSequence),
Client: rpc,
Decoder: nil,
AccountStore: "main",
AccountStore: "acc",
}
}
@ -55,7 +55,8 @@ func defaultChainID() (string, error) {
// EnsureSequence - automatically set sequence number if none provided
func EnsureSequence(ctx CoreContext) (CoreContext, error) {
if viper.IsSet(client.FlagSequence) {
// Should be viper.IsSet, but this does not work - https://github.com/spf13/viper/pull/331
if viper.GetInt64(client.FlagSequence) != 0 {
return ctx, nil
}
from, err := ctx.GetFromAddress()