MCPcopy Create free account
hub / github.com/CPChain/chain / CommitTrie

Method CommitTrie

core/state/state_object.go:224–234  ·  view source on GitHub ↗

CommitTrie the storage trie of the object to db. This updates the trie root.

(db Database)

Source from the content-addressed store, hash-verified

222// CommitTrie the storage trie of the object to db.
223// This updates the trie root.
224func (self *stateObject) CommitTrie(db Database) error {
225 self.updateTrie(db)
226 if self.dbErr != nil {
227 return self.dbErr
228 }
229 root, err := self.trie.Commit(nil)
230 if err == nil {
231 self.data.Root = root
232 }
233 return err
234}
235
236// AddBalance removes amount from c's balance.
237// It is used to add funds to the destination account of a transfer.

Callers 1

CommitMethod · 0.80

Calls 2

updateTrieMethod · 0.95
CommitMethod · 0.65

Tested by

no test coverage detected