Merge pull request #247 from ethcore/fix_suicide
Fixing suicide with self-refund to be consistent with CPP.
This commit is contained in:
commit
b858fc6e4b
@ -1 +1 @@
|
||||
Subproject commit e838fd90998fc5502d0b7c9427a4c231f9a6953d
|
||||
Subproject commit dc86e6359675440aea59ddb48648a01c799925d8
|
@ -215,7 +215,13 @@ impl<'a> Ext for Externalities<'a> {
|
||||
fn suicide(&mut self, refund_address: &Address) {
|
||||
let address = self.origin_info.address.clone();
|
||||
let balance = self.balance(&address);
|
||||
if &address == refund_address {
|
||||
// TODO [todr] To be consisted with CPP client we set balance to 0 in that case.
|
||||
self.state.sub_balance(&address, &balance);
|
||||
} else {
|
||||
trace!("Suiciding {} -> {} (xfer: {})", address, refund_address, balance);
|
||||
self.state.transfer_balance(&address, refund_address, &balance);
|
||||
}
|
||||
self.substate.suicides.insert(address);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user