1

Suppose this scenario:

There are 2 wallets called wallet1 and wallet1 on the same node in testnet blockchain.

wallet1 balance: 0.001 BTC

wallet2 balance: 0 BTC

I am trying to send 0.001 BTCs from wallet1 to wallet2; so I use the sendtoaddress command like this:

bitcoin-cli -testnet -rpcwallet=wallet1 sendtoaddress <wallet2 address> 0.001 "" "" true.

This gives me a txid which none of the blockchain explorers like live.blockcypher.com/btc-testnet can't recognize it!

It deducts the coin from wallet1 and I don't know where does it go!?

For solving this, I tried to get the transaction hex to broadcast it via some other platforms to check if the raw transaction is correct and it was OK and after broadcasting it via the other platform, blockchain explorers could detect the transaction id.

Here are my question:

  1. Isn't just using sendtoaddress enough for sending coins?
  2. Why the broadcasting process doesn't complete on my node?

Here is my bitcoin.conf:

[test]
prune=600
blocksonly=1
maxconnections=15
testnet=1
regtest=0

deprecatedrpc=accounts
deprecatedrpc=addwitnessaddress
deprecatedrpc=signrawtransaction
deprecatedrpc=validateaddress

minrelaytxfee=0.0001
maxmempool=200
maxreceiverbuffer=2500
maxsendbuffer=500
dbcache=16000

rpcbind=0.0.0.0
rpcallowip=--

rpcuser=--
rpcpassword=--

server=1
rest=1
daemon=1
  • If it works when you broadcast the same transaction via explorers, then there is likely an issue with how your node connects to the testnet - your peers might not be broadcasting/accepting your transaction, or you just might not be connected at all – Raghav Sood May 8 at 2:43
  • @RaghavSood I think its connected because when I send bitcoin from an external wallet to my node based wallet, after confirmations, it detects the correct balance. I have searched about my problem and I think it might be because of the bitcoin.conf. I have used blocksonly=1 in test block. Can it be the reason? – Emad Mamaghani May 8 at 7:04
0

The main problem is the parameter blocksonly=1 in bitcoin config file. This prevents the node to broadcast transactions to the netwrok. I removed it and it works fine!

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.