GetPrivateStateRoot gets the root(hash) for private state associated with the root of Merkle tree in public chain.
(db database.Database, blockRoot common.Hash)
| 36 | |
| 37 | // GetPrivateStateRoot gets the root(hash) for private state associated with the root of Merkle tree in public chain. |
| 38 | func GetPrivateStateRoot(db database.Database, blockRoot common.Hash) common.Hash { |
| 39 | exist, _ := db.Has(append(privateRootPrefix, blockRoot[:]...)) |
| 40 | if exist { |
| 41 | root, _ := db.Get(append(privateRootPrefix, blockRoot[:]...)) |
| 42 | return common.BytesToHash(root) |
| 43 | } |
| 44 | return common.Hash{} |
| 45 | } |
| 46 | |
| 47 | // WritePrivateStateRoot writes the root(hash) for private state associated with the root of Merkle tree in public chain. |
| 48 | func WritePrivateStateRoot(db database.Database, blockRoot, root common.Hash) error { |