mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-25 14:16:44 +00:00
More logging around why Withdraw would not be recorded
This commit is contained in:
parent
173123f62f
commit
dfa4b2cba6
1 changed files with 6 additions and 0 deletions
|
|
@ -21,6 +21,7 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"maps"
|
"maps"
|
||||||
|
"os"
|
||||||
"slices"
|
"slices"
|
||||||
"sync"
|
"sync"
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
|
|
@ -894,9 +895,11 @@ func (s *StateDB) SelfDestruct(addr common.Address) uint256.Int {
|
||||||
stateObject = s.mvRecordWritten(stateObject)
|
stateObject = s.mvRecordWritten(stateObject)
|
||||||
|
|
||||||
prevBalance = *(stateObject.Balance())
|
prevBalance = *(stateObject.Balance())
|
||||||
|
|
||||||
// Regardless of whether it is already destructed or not, we do have to
|
// Regardless of whether it is already destructed or not, we do have to
|
||||||
// journal the balance-change, if we set it to zero here.
|
// journal the balance-change, if we set it to zero here.
|
||||||
if !stateObject.Balance().IsZero() {
|
if !stateObject.Balance().IsZero() {
|
||||||
|
fmt.Fprintf(os.Stderr, "[Firehose] SelfDestruct: previous balance is non-zero (addr=%s)\n", addr)
|
||||||
stateObject.SetBalance(new(uint256.Int))
|
stateObject.SetBalance(new(uint256.Int))
|
||||||
}
|
}
|
||||||
// If it is already marked as self-destructed, we do not need to add it
|
// If it is already marked as self-destructed, we do not need to add it
|
||||||
|
|
@ -913,10 +916,13 @@ func (s *StateDB) SelfDestruct(addr common.Address) uint256.Int {
|
||||||
func (s *StateDB) SelfDestruct6780(addr common.Address) (uint256.Int, bool) {
|
func (s *StateDB) SelfDestruct6780(addr common.Address) (uint256.Int, bool) {
|
||||||
stateObject := s.getStateObject(addr)
|
stateObject := s.getStateObject(addr)
|
||||||
if stateObject == nil {
|
if stateObject == nil {
|
||||||
|
fmt.Fprintf(os.Stderr, "[Firehose] SelfDestruct6780: stateObject is nil (addr=%s)\n", addr)
|
||||||
return uint256.Int{}, false
|
return uint256.Int{}, false
|
||||||
}
|
}
|
||||||
if stateObject.newContract {
|
if stateObject.newContract {
|
||||||
return s.SelfDestruct(addr), true
|
return s.SelfDestruct(addr), true
|
||||||
|
} else {
|
||||||
|
fmt.Fprintf(os.Stderr, "[Firehose] SelfDestruct6780: stateObject is not a new contract (addr=%s)\n", addr)
|
||||||
}
|
}
|
||||||
return *(stateObject.Balance()), false
|
return *(stateObject.Balance()), false
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue