From b1c084696edc5675446a8d448c6dd06199f8a07c Mon Sep 17 00:00:00 2001 From: Luca Moser Date: Thu, 25 Apr 2019 11:19:37 +0200 Subject: [PATCH] reinit funcs in account UpdateSettings() --- account/account.go | 5 +++++ account/settings.go | 4 +--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/account/account.go b/account/account.go index d15b9e51b..7f04b4f3c 100644 --- a/account/account.go +++ b/account/account.go @@ -230,6 +230,11 @@ func (acc *account) UpdateSettings(setts *Settings) error { return errors.Wrap(err, "unable to shutdown plugin in update settings op.") } + // make sure all needed funcs are initialized + if err := initFuncs(setts); err != nil { + return err + } + // make a copy acc.setts = setts diff --git a/account/settings.go b/account/settings.go index 19b8582c1..602c63346 100644 --- a/account/settings.go +++ b/account/settings.go @@ -145,18 +145,16 @@ var emptySeed = strings.Repeat("9", 81) func DefaultSettings(setts ...Settings) *Settings { if len(setts) == 0 { iotaAPI, _ := api.ComposeAPI(api.HTTPClientSettings{}) - inMemoryEmptySeedProv := NewInMemorySeedProvider(emptySeed) return &Settings{ MWM: 14, Depth: 3, - SeedProv: inMemoryEmptySeedProv, + SeedProv: NewInMemorySeedProvider(emptySeed), SecurityLevel: consts.SecurityLevelMedium, TimeSource: ×rc.SystemClock{}, EventMachine: &event.DiscardEventMachine{}, API: iotaAPI, Store: inmemory.NewInMemoryStore(), InputSelectionStrat: DefaultInputSelection, - PrepareTransfers: DefaultPrepareTransfers(iotaAPI, inMemoryEmptySeedProv), } } defaultValue := func(val uint64, should uint64) uint64 {