storage.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:lbryum-server 作者: lbryio 项目源码 文件源码
def get_history(self, addr):
        out = []
        o = self.listunspent(addr)
        for item in o:
            out.append((item['height'], item['tx_hash']))
        h = self.db_hist.get(addr)
        if h:
            for item in re.findall('.{80}', h, flags=re.DOTALL):
                txi = item[0:32].encode('hex')
                hi = hex_to_int(item[36:40])
                txo = item[40:72].encode('hex')
                ho = hex_to_int(item[76:80])
                out.append((hi, txi))
                out.append((ho, txo))
        # uniqueness
        out = set(out)
        # sort by height then tx_hash
        out = sorted(out)
        return map(lambda x: {'height': x[0], 'tx_hash': x[1]}, out)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号