|
|
|
@ -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 |
|
|
|
|