Skip to content

Commit

Permalink
Merge pull request #129 from pedr0-fr/patch-2
Browse files Browse the repository at this point in the history
Fix confirmations from BlockchairAPI.get_unspent_testnet() and BlockstreamAPI
  • Loading branch information
Teran McKinney committed Aug 9, 2020
2 parents 9943981 + 75cd9c9 commit d3cadd1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bit/network/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ def get_unspent_testnet(cls, address):
unspents.extend(
Unspent(
utxo['value'],
block_height - utxo['block_id'],
block_height - utxo['block_id'] + 1 if utxo['block_id'] != -1 else 0,
script_pubkey,
utxo['transaction_hash'],
utxo['index'],
Expand Down Expand Up @@ -460,7 +460,7 @@ def get_unspent(cls, address):
[
Unspent(
tx["value"],
block_height - tx["status"]["block_height"] if tx["status"]["confirmed"] else 0,
block_height - tx["status"]["block_height"] + 1 if tx["status"]["confirmed"] else 0,
script_pubkey,
tx["txid"],
tx["vout"],
Expand Down Expand Up @@ -490,7 +490,7 @@ def get_unspent_testnet(cls, address):
return [
Unspent(
tx["value"],
block_height - tx["status"]["block_height"] if tx["status"]["confirmed"] else 0,
block_height - tx["status"]["block_height"] + 1 if tx["status"]["confirmed"] else 0,
script_pubkey,
tx["txid"],
tx["vout"],
Expand Down

0 comments on commit d3cadd1

Please sign in to comment.