From 5f6c6e8306972faf655f23828c6ef9c7354c2512 Mon Sep 17 00:00:00 2001 From: KamiD <44460798+KamiD@users.noreply.github.com> Date: Mon, 7 Jun 2021 17:32:00 +0800 Subject: [PATCH] Merge PR: add switch to deleteAccount and deleteState (#900) * add switch to deleteAccount and deleteState * change switch to false --- x/evm/watcher/querier.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/x/evm/watcher/querier.go b/x/evm/watcher/querier.go index 777c45011c..5afe928dde 100644 --- a/x/evm/watcher/querier.go +++ b/x/evm/watcher/querier.go @@ -282,6 +282,9 @@ func (q Querier) GetAccountFromRdb(addr sdk.AccAddress) (*types.EthAccount, erro } func (q Querier) DeleteAccountFromRdb(addr sdk.AccAddress) { + if !q.enabled() { + return + } q.store.Delete(append(prefixRpcDb, GetMsgAccountKey(addr.Bytes())...)) } @@ -328,6 +331,9 @@ func (q Querier) GetStateFromRdb(key []byte) ([]byte, error) { } func (q Querier) DeleteStateFromRdb(addr common.Address, key []byte) { + if !q.enabled() { + return + } q.store.Delete(append(prefixRpcDb, GetMsgStateKey(addr, key)...)) }