MCPcopy
hub / github.com/bnb-chain/bsc / Lock

Method Lock

accounts/keystore/keystore.go:322–331  ·  view source on GitHub ↗

Lock removes the private key with the given address from memory.

(addr common.Address)

Source from the content-addressed store, hash-verified

320
321// Lock removes the private key with the given address from memory.
322func (ks *KeyStore) Lock(addr common.Address) error {
323 ks.mu.Lock()
324 if unl, found := ks.unlocked[addr]; found {
325 ks.mu.Unlock()
326 ks.expire(addr, unl, time.Duration(0)*time.Nanosecond)
327 } else {
328 ks.mu.Unlock()
329 }
330 return nil
331}
332
333// TimedUnlock unlocks the given account with the passphrase. The account
334// stays unlocked for the duration of timeout. A timeout of 0 unlocks the account

Callers 15

TestAccountManagementFunction · 0.95
generateMethod · 0.80
NewMeterFunction · 0.80
NewMeterForcedFunction · 0.80
StopMethod · 0.80
CountMethod · 0.80
tickMethod · 0.80
SnapshotMethod · 0.80
UpdateMethod · 0.80
UpdateSinceMethod · 0.80
SnapshotMethod · 0.80
UpdateMethod · 0.80

Calls 2

expireMethod · 0.95
UnlockMethod · 0.45

Tested by 15

TestAccountManagementFunction · 0.76
assertBlocksMethod · 0.64
makeAddressReserverFunction · 0.64
makeAddressReserverFunction · 0.64
testAddBalanceFunction · 0.64
testSetNonceFunction · 0.64
addNodesMethod · 0.64
NextMethod · 0.64
CloseMethod · 0.64
setAnswersMethod · 0.64
checkCallsMethod · 0.64
ResolveMethod · 0.64