lite2: correctly return the results of the "latest" block (#4931)

Closes #4837

- `/block_results`

  before:

  failed to update light client to 7: failed to obtain the header #7: signed header not found

  after:

  We can't return the latest block results because we won't be able to
  prove them. Return the results for the previous block instead.

- /block_results?height=X`

  no changes
This commit is contained in:
Anton Kaliaev
2020-06-02 18:51:50 +04:00
committed by GitHub
parent da924fc62d
commit 8ab0a4c3b0
2 changed files with 22 additions and 7 deletions
+4 -4
View File
@@ -36,16 +36,16 @@ Example:
start a fresh instance:
lite cosmoshub-3 -p 52.57.29.196:26657 -w public-seed-node.cosmoshub.certus.one:26657
lite cosmoshub-3 -p http://52.57.29.196:26657 -w http://public-seed-node.cosmoshub.certus.one:26657
--height 962118 --hash 28B97BE9F6DE51AC69F70E0B7BFD7E5C9CD1A595B7DC31AFF27C50D4948020CD
continue from latest state:
lite cosmoshub-3 -p 52.57.29.196:26657 -w public-seed-node.cosmoshub.certus.one:26657
lite cosmoshub-3 -p http://52.57.29.196:26657 -w http://public-seed-node.cosmoshub.certus.one:26657
`,
RunE: runProxy,
Args: cobra.ExactArgs(1),
Example: `lite cosmoshub-3 -p 52.57.29.196:26657 -w public-seed-node.cosmoshub.certus.one:26657
Example: `lite cosmoshub-3 -p http://52.57.29.196:26657 -w http://public-seed-node.cosmoshub.certus.one:26657
--height 962118 --hash 28B97BE9F6DE51AC69F70E0B7BFD7E5C9CD1A595B7DC31AFF27C50D4948020CD`,
}
@@ -102,7 +102,7 @@ func runProxy(cmd *cobra.Command, args []string) error {
db, err := dbm.NewGoLevelDB("lite-client-db", home)
if err != nil {
return fmt.Errorf("new goleveldb: %w", err)
return fmt.Errorf("can't create a db: %w", err)
}
var c *lite.Client