Skip to content
Snippets Groups Projects
Commit 58774abd authored by Benjamin Bollen's avatar Benjamin Bollen Committed by GitHub
Browse files

Merge pull request #442 from silasdavis/lazy-account-init

Add documentation comment on lazy initialisation of account public keys
parents 7f5c95b7 a4e3a316
No related branches found
No related tags found
No related merge requests found
......@@ -203,6 +203,12 @@ func getOrMakeOutputs(state AccountGetter, accounts map[string]*acm.Account, out
return accounts, nil
}
// Since all ethereum accounts implicitly exist we sometimes lazily create an Account object to represent them
// only when needed. Sometimes we need to create an unknown Account knowing only its address (which is expected to
// be a deterministic hash of its associated public key) and not its public key. When we eventually receive a
// transaction acting on behalf of that account we will be given a public key that we can check matches the address.
// If it does then we will associate the public key with the stub account already registered in the system once and
// for all time.
func checkInputPubKey(acc *acm.Account, in *txs.TxInput) error {
if acc.PubKey == nil {
if in.PubKey == nil {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment