Handle case of empty (new) account
This commit is contained in:
parent
05988623af
commit
10540e38db
|
@ -158,6 +158,11 @@ func (ctx CoreContext) NextSequence(address []byte) (int64, error) {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(res) == 0 {
|
||||||
|
fmt.Printf("No account found, defaulting to sequence 0\n")
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
|
||||||
account, err := ctx.Decoder(res)
|
account, err := ctx.Decoder(res)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
|
Loading…
Reference in New Issue