Skip to content

Commit

Permalink
reinit funcs in account UpdateSettings()
Browse files Browse the repository at this point in the history
  • Loading branch information
luca-moser committed Apr 25, 2019
1 parent f1edf00 commit b1c0846
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 5 additions & 0 deletions account/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 1 addition & 3 deletions account/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -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: &timesrc.SystemClock{},
EventMachine: &event.DiscardEventMachine{},
API: iotaAPI,
Store: inmemory.NewInMemoryStore(),
InputSelectionStrat: DefaultInputSelection,
PrepareTransfers: DefaultPrepareTransfers(iotaAPI, inMemoryEmptySeedProv),
}
}
defaultValue := func(val uint64, should uint64) uint64 {
Expand Down

0 comments on commit b1c0846

Please sign in to comment.