question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Transaction broadcast failed, or Unspents were already used

See original GitHub issue

Hi. I can’t send my funds to another address because constantly getting an follow errors

>>> tx = m.send([('...', 0.131, 'btc')])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/.pyenv/btc_wallet/lib/python3.6/site-packages/bit/wallet.py", line 566, in send
    NetworkAPI.broadcast_tx_testnet(tx_hex)
  File "/home/.pyenv/btc_wallet/lib/python3.6/site-packages/bit/network/services.py", line 442, in broadcast_tx_testnet
    raise ConnectionError('Transaction broadcast failed, or '
ConnectionError: Transaction broadcast failed, or Unspents were already used.
>>> m.get_balance('usd')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/.pyenv/btc_wallet/lib/python3.6/site-packages/bit/wallet.py", line 460, in get_balance
    self.get_unspents()
  File "/home/.pyenv/btc_wallet/lib/python3.6/site-packages/bit/wallet.py", line 468, in get_unspents
    self.unspents[:] = NetworkAPI.get_unspent_testnet(self.address)
  File "/home/.pyenv/btc_wallet/lib/python3.6/site-packages/bit/network/services.py", line 395, in get_unspent_testnet
    raise ConnectionError('All APIs are unreachable.')
ConnectionError: All APIs are unreachable.

What I can do for solve these errors?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

1reaction
bjarnemagnussencommented, Jan 6, 2021

Just to be really sure, you are on mainnet? Because the error message shows it as if you try to send the transaction using testnet.

1reaction
bjarnemagnussencommented, May 27, 2020

I think that currently all testnet APIs are offline. I have an open PR (#86) that should fix it.

In the meantime if you have the possibility to run your own node you can connect to it with bit (https://github.com/ofek/bit/blob/7d933640f43c697cd0ccfa413262e278401eaa87/bit/network/services.py#L439).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python Bit: ConnectionError: Transaction broadcast failed, or ...
ConnectionError : Transaction broadcast failed, or Unspents were already used. I tried to wait (until some additional confirmations, ...
Read more >
Python broadcast tx - ProgramCreek.com
IGNORED_ERRORS: pass if success is False: raise ConnectionError('Transaction broadcast failed, or ' 'Unspents were already used.
Read more >
I get a Broadcast Error when trying to send or exchange.
This is the Broadcast Error message that is displayed on Android. ... resulting to a transaction that uses an output that's already spent....
Read more >
My "send" transaction is stuck in Ledger Live
This error happens because the Ledger account you're trying to spend from contains too many coin fragments (also called Unspent Transaction ...
Read more >
Error message still returned after transaction was indeed ...
I use bitcoinj to create the following method to broadcast a raw transacion in testnet, and I did see on bitcoin explorer that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found