hexonaut / bitcoin-transaction

Send Bitcoins from one wallet to another. This is designed to be as simple to use as possible.
MIT License
50 stars 37 forks source link

transaction not going through #17

Closed gideonokyere closed 5 years ago

gideonokyere commented 5 years ago

i always get "You do not have enough in your wallet to send that much" when i try to send btc to a different address. i have try all the fee type . my balance is 0.10545915 and am sending 0.001343365.

hexonaut commented 5 years ago

You have to make sure incoming transactions have 6+ confirmations before trying to send them out. This can take tens of minutes sometimes. If this is still failing then set a breakpoint on line 200 and check why availableSat is less than amtSatoshi. Which of these numbers isn't lining up?

gideonokyere commented 5 years ago

when i console log the availableSat i get 0

hexonaut commented 5 years ago

For whatever reason the from address is not reading in the UTXOs properly. Make sure from is set on sendTransaction(options) in the options object and that is set to the correct address. The blockexplorer default UTXO endpoint seems to be working fine from what I can see.

gideonokyere commented 5 years ago

ok i will check it

gideonokyere commented 5 years ago

Am still getting the same error

gideonokyere commented 5 years ago

this is what i get when i console log utxos [ { txid: '388406b5eab4738f05267c75555607480bd8e815f7d54962c87525dc65823f2f', vout: 0, satoshis: 13164888, confirmations: -4024 } ]

hexonaut commented 5 years ago

The issue is with the confirmations being -4024. They need to be 6 or more. Not even sure how a number like -4024 gets returned. Are you on mainnet? If so, try switching to a different provider: bitcoinTransaction.providers.utxo.mainnet.default = bitcoinTransaction.providers.utxo.mainnet.blockchain;

There is only one provider on testnet unfortunately, so it may be the case that mainnet is working fine, but the testnet provider is just broken.