server.py 文件源码

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

项目:two1-python 作者: 21dotco 项目源码 文件源码
def close(self, deposit_txid, deposit_txid_signature):
        # Load channel
        channel = self._load_channel(deposit_txid)

        # Check if a payment has been made to this chanel
        if channel['payment_tx'] is None:
            raise Exception("No payment has been made to this channel.")

        # Verify deposit txid singature
        public_key = channel['redeem_script'].customer_public_key
        assert public_key.verify(
            deposit_txid.encode(), bitcoin.Signature.from_der(deposit_txid_signature)
        ), "Invalid deposit txid signature."

        # Return payment txid
        return str(channel['payment_tx'].hash)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号