Merge pull request #1671 from flicker-harmony/pr_tx_history_fix

fix storage instance and 0x address case
pull/1674/head
Minh Doan 5 years ago committed by GitHub
commit 4dc5ef5543
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      node/node_explorer.go

@ -146,7 +146,10 @@ func (node *Node) commitBlockForExplorer(block *types.Block) {
func (node *Node) GetTransactionsHistory(address string) ([]common.Hash, error) {
addressData := &explorer.Address{}
key := explorer.GetAddressKey(address)
bytes, err := explorer.GetStorageInstance(node.SelfPeer.IP, node.SelfPeer.Port, true).GetDB().Get([]byte(key))
bytes, err := explorer.GetStorageInstance(node.SelfPeer.IP, node.SelfPeer.Port, false).GetDB().Get([]byte(key))
if err != nil {
return make([]common.Hash, 0), nil
}
if err = rlp.DecodeBytes(bytes, &addressData); err != nil {
utils.Logger().Error().Err(err).Msg("[Explorer] Cannot convert address data from DB")
return nil, err

Loading…
Cancel
Save