Storage should kill zero entries.

This commit is contained in:
Gav Wood 2016-01-14 22:45:50 +01:00
parent 478cebf42f
commit 6f5d383834

View File

@ -187,7 +187,10 @@ impl Account {
if f == &Filth::Dirty { if f == &Filth::Dirty {
// cast key and value to trait type, // cast key and value to trait type,
// so we can call overloaded `to_bytes` method // so we can call overloaded `to_bytes` method
t.insert(k, &encode(&U256::from(v.as_slice()))); match v.is_zero() {
true => t.remove(k),
false => t.insert(k, &encode(&U256::from(v.as_slice()))),
}
*f = Filth::Clean; *f = Filth::Clean;
} }
} }