Skip to content
This repository has been archived by the owner on Mar 5, 2020. It is now read-only.

Commit

Permalink
Sped up injection two-fold, by skipping calls to /get_required_keys.
Browse files Browse the repository at this point in the history
We know what the required keys are, so skip that check.
  • Loading branch information
abourget committed May 31, 2018
1 parent 48cd19e commit 23c7d93
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions bios/bios.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,13 @@ func (b *BIOS) RunBootSequence() error {

b.Log.Printf("Generated ephemeral keys:\n\n\tPublic key: %s\n\tPrivate key: %s..%s\n\n", pubKey, privKey[:6], privKey[len(privKey)-6:])

// Don't get `get_required_keys` from the blockchain, this adds
// latency.. and we KNOW the key you're going to ask :) It's the
// only key we're going to sign with anyway..
b.TargetNetAPI.SetCustomGetRequiredKeys(func(tx *eos.Transaction) (out []ecc.PublicKey, err error) {
return append(out, pubKey), nil
})

// Store keys in wallet, to sign `SetCode` and friends..
if err := b.TargetNetAPI.Signer.ImportPrivateKey(privKey); err != nil {
return fmt.Errorf("ImportWIF: %s", err)
Expand Down

0 comments on commit 23c7d93

Please sign in to comment.