blockchain.py 文件源码

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

项目:docforever 作者: Udala 项目源码 文件源码
def pushtxn(raw_tx):
  '''Insight send raw tx API''' 
  url = PUSH_TX_URL
  payload = urllib.urlencode({
    "rawtx": raw_tx 
  })
  result = urlfetch.fetch(url,
    method=urlfetch.POST,
    payload=payload
  )

  if result.status_code == 200:  
    j = json.loads(result.content)
    txid = j.get('txid')
    return txid, raw_tx
  else: 
    msg = 'Error accessing insight API:'+str(result.status_code)+" "+str(result.content)
    ErrorNotification.new(msg) 
    return None, msg
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号