Can someone point me to where the state root is updated after each transaction is executed in the block? This is for Aleth
Asked
Active
Viewed 63 times
1 Answers
1
I found it myself:
template <class DB> void GenericTrieDB<DB>::insert(bytesConstRef _key,
bytesConstRef _value)
{
std::string rootValue = node(m_root);
assert(rootValue.size());
bytes b = mergeAt(RLP(rootValue), m_root, NibbleSlice(_key), _value);
// mergeAt won't attempt to delete the node if it's less than 32 bytes
// However, we know it's the root node and thus always hashed.
// So, if it's less than 32 (and thus should have been deleted but wasn't)
then we delete it here.
if (rootValue.size() < 32)
forceKillNode(m_root);
m_root = forceInsertNode(&b);
}
user2584960
- 229
- 1
- 5