MCPcopy Create free account
hub / github.com/CPChain/chain / GetBalance

Method GetBalance

core/state/statedb.go:191–197  ·  view source on GitHub ↗

Retrieve the balance from the given address or 0 if object not found

(addr common.Address)

Source from the content-addressed store, hash-verified

189
190// Retrieve the balance from the given address or 0 if object not found
191func (self *StateDB) GetBalance(addr common.Address) *big.Int {
192 stateObject := self.getStateObject(addr)
193 if stateObject != nil {
194 return stateObject.Balance()
195 }
196 return common.Big0
197}
198
199func (self *StateDB) GetNonce(addr common.Address) uint64 {
200 stateObject := self.getStateObject(addr)

Callers

nothing calls this directly

Calls 2

getStateObjectMethod · 0.95
BalanceMethod · 0.45

Tested by

no test coverage detected