cm/geth: set dropFn for copydb, fixes #18525

This commit is contained in:
Martin Holst Swende 2019-02-07 08:56:45 +01:00
parent c57166caa3
commit f14c3f0aef
No known key found for this signature in database
GPG key ID: 683B438C05A5DDF0

View file

@ -372,7 +372,9 @@ func copyDb(ctx *cli.Context) error {
chain, chainDb := utils.MakeChain(ctx, stack)
syncmode := *utils.GlobalTextMarshaler(ctx, utils.SyncModeFlag.Name).(*downloader.SyncMode)
dl := downloader.New(syncmode, chainDb, new(event.TypeMux), chain, nil, nil)
// Set a non-nil dropfunction to prevent panic
dropFn := func(id string) {}
dl := downloader.New(syncmode, chainDb, new(event.TypeMux), chain, nil, dropFn)
// Create a source peer to satisfy downloader requests from
db, err := ethdb.NewLDBDatabase(ctx.Args().First(), ctx.GlobalInt(utils.CacheFlag.Name), 256)