Skip to content
Snippets Groups Projects
Unverified Commit 6cb2790b authored by Silas Davis's avatar Silas Davis
Browse files

Add documentation comment on lazily initialisation of account public keys

parent 0a4c5acd
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