Bitcoin Forum
May 21, 2024, 10:57:22 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: problem sending raw tx via bicoind  (Read 1025 times)
doof (OP)
Hero Member
*****
Offline Offline

Activity: 765
Merit: 503


View Profile WWW
May 14, 2014, 10:12:57 PM
 #1

I have tried with a few c# wrappers, posting raw tx to bitcoind 0.9.1.

I previously had it working with a simple, one input tx, however, I can no longer successfully broadcast tx's.  Other bitcoind rpc calls work, so Im confident the node is configured correctly.  I've created the below signature via brain wallet, and it fails too.  Broadcasting via block chain.info push tx work though.

Any reasons why it wouldn't work via bitcoind?

0100000003b5adf6c671f83638e41e8e33d748f3ad0f0001c8f4c6d6ff30fd87f41729401801000 0008b48304502210098caad4ab3dc0feeb1f42ed7de3e8ec54e76d994ab093f05189a154b76dea4 ef0220687d8fee22fe43424999e851ed9363bd6817cf0b71d4069e6b2b1ab1aed88c0e014104c70 5d4c7d65cb9cf1f71a31a998e9d3bb4af6c5ed435b12c9359effc471f02351d2515e07e36e2361c 176e489fd844c70294c5e9eeb237e840c3b7ed200a3b3affffffff0d4a53d1a3ed3ffc57b6c8a5c 6ef9e7fe6dd18ae95ed7a596c74f18c2189370d010000008a4730440220625289ae4741010d8007 5d1abda4b0ae76e1100858dc032bc9ff091baa940eed02202ad030ecdab49a39bf97ae7e67ce009 9520877d1469f553c86ecb6574f871902014104c705d4c7d65cb9cf1f71a31a998e9d3bb4af6c5e d435b12c9359effc471f02351d2515e07e36e2361c176e489fd844c70294c5e9eeb237e840c3b7e d200a3b3affffffff8c0a8883b755a1d7293db5afd0bc6c549e1b6e647adde12b2091ef115a18cf 8a000000008b483045022005e9d0f2fc19af2af161eff5ab8456de2419664bdefd86979e3949282 35797c1022100b69de453350fbfc77da395966cf84952eb45f7cead9f784b7f06bbbe325a210001 4104c705d4c7d65cb9cf1f71a31a998e9d3bb4af6c5ed435b12c9359effc471f02351d2515e07e3 6e2361c176e489fd844c70294c5e9eeb237e840c3b7ed200a3b3affffffff02a086010000000000 1976a9148d985e4cfe89aad0c411be3b512d097cacb484af88acd4cc4a00000000001976a914a80 25359c5d54cb6414fc86933984624fbc5cca088ac00000000
Foxpup
Legendary
*
Offline Offline

Activity: 4368
Merit: 3045


Vile Vixen and Miss Bitcointalk 2021-2023


View Profile
May 15, 2014, 04:14:03 AM
 #2

Your program should be checking the error codes returned by bitcoind, because if it did, you would know that the reason it's failing is because the transaction is already in the blockchain (error code 5). You can't send a transaction that's already confirmed; all synchronised nodes already have it, so there's no point.

Will pretend to do unspeakable things (while actually eating a taco) for bitcoins: 1K6d1EviQKX3SVKjPYmJGyWBb1avbmCFM4
I am not on the scammers' paradise known as Telegram! Do not believe anyone claiming to be me off-forum without a signed message from the above address! Accept no excuses and make no exceptions!
doof (OP)
Hero Member
*****
Offline Offline

Activity: 765
Merit: 503


View Profile WWW
May 15, 2014, 06:03:16 AM
 #3

Your program should be checking the error codes returned by bitcoind, because if it did, you would know that the reason it's failing is because the transaction is already in the blockchain (error code 5). You can't send a transaction that's already confirmed; all synchronised nodes already have it, so there's no point.

Sorry, i should have explained that better.  This is the one I created and tried to send via 2 different c# wrappers.  After failing via bitcoind I validated it using brain wallet and pushed it via blockchain.info successfully, to prove that it was indeed a valid signed TX.

The only error I get back from bitcoind is a 500 error.

I have previously sent tx via the same c# lib / bitcoind, however, all attempts now fail.
doof (OP)
Hero Member
*****
Offline Offline

Activity: 765
Merit: 503


View Profile WWW
May 15, 2014, 06:13:40 AM
 #4

Steps I have tried to fix so far:

Create smaller signed tx with only 1 input
Change the amount to be sent value to a 0.01btc incase there was a size / fee limit
Increase the fee size

This was a previously successful tx https://blockchain.info/tx/4c5c3345d3d500269d0c0bed6b286cd1378e7e6749b9eb975d0394197aa9d71a
doof (OP)
Hero Member
*****
Offline Offline

Activity: 765
Merit: 503


View Profile WWW
May 15, 2014, 06:40:56 AM
 #5

Here is a new one.  Using bitcoind decode raw tx via the wrapper works fine too.

0100000001D0C5B9AE52B005C51930C3C63F46DABB9B6D5BE78A244B36D5E0CA29CB3A3C6901000 0008B48304502201C779DF47F3729B20CC127F6B69D035B674F55776B7846D8E8A9384D7D54F865 022100A24EF078FC35121EA3C5525BEB51C7865ED80416391A3F87A23C9AAAC96DEA37014104C70 5D4C7D65CB9CF1F71A31A998E9D3BB4AF6C5ED435B12C9359EFFC471F02351D2515E07E36E2361C 176E489FD844C70294C5E9EEB237E840C3B7ED200A3B3AFFFFFFFF0110270000000000001976A91 48D985E4CFE89AAD0C411BE3B512D097CACB484AF88AC00000000
mcaizgk2
Member
**
Offline Offline

Activity: 66
Merit: 10


View Profile
May 15, 2014, 04:43:22 PM
 #6

@doof which C# wrappers did you use for your test?
apxu
Member
**
Offline Offline

Activity: 229
Merit: 13


View Profile
May 15, 2014, 06:34:58 PM
 #7

Here is a new one.  Using bitcoind decode raw tx via the wrapper works fine too.

is it yours?
https://blockchain.info/tx/7691d57dc624790c2cad5ce943de9cfc2e4c0a1986d6622e6521061367ee40cb
https://blockchain.info/tx/7691d57dc624790c2cad5ce943de9cfc2e4c0a1986d6622e6521061367ee40cb?format=hex
output: 0.0001 BTC
fees: 0.048921 BTC  Shocked

1) you should not split hex-representation to smaller pieces
2) your local bitcoind should have all inputs - wait for new block and check that previous tx has at least 1 confirmation before spending it
3) USE TESTNET! (I've asked for your testnet address twice!)
doof (OP)
Hero Member
*****
Offline Offline

Activity: 765
Merit: 503


View Profile WWW
May 16, 2014, 01:32:47 AM
 #8

Here is a new one.  Using bitcoind decode raw tx via the wrapper works fine too.

is it yours?
https://blockchain.info/tx/7691d57dc624790c2cad5ce943de9cfc2e4c0a1986d6622e6521061367ee40cb
https://blockchain.info/tx/7691d57dc624790c2cad5ce943de9cfc2e4c0a1986d6622e6521061367ee40cb?format=hex
output: 0.0001 BTC
fees: 0.048921 BTC  Shocked

1) you should not split hex-representation to smaller pieces
2) your local bitcoind should have all inputs - wait for new block and check that previous tx has at least 1 confirmation before spending it
3) USE TESTNET! (I've asked for your testnet address twice!)


No, and oops!  Oh well, $20 mistake.  I've tried so many combinations now.   Yes yes, I will get test net sorted on the weekend.  Fulltime job and 2year old sucking up my free time.
doof (OP)
Hero Member
*****
Offline Offline

Activity: 765
Merit: 503


View Profile WWW
May 16, 2014, 01:34:53 AM
 #9

@doof which C# wrappers did you use for your test?

I've tried a few off git hub.

https://github.com/BitKoot/BitcoinRpcSharp
https://github.com/LarsHoldgaard/bitcoin-wrapper
https://github.com/GeorgeKimionis/BitcoinLib



mcaizgk2
Member
**
Offline Offline

Activity: 66
Merit: 10


View Profile
May 16, 2014, 03:10:21 AM
 #10


All of the above wrappers should work without a problem, I can definitely guarantee that the last one (BitcoinLib) handles raw transactions flawlessly so please follow @apxu's instructions and give it another go.
doof (OP)
Hero Member
*****
Offline Offline

Activity: 765
Merit: 503


View Profile WWW
May 16, 2014, 03:35:06 AM
 #11


All of the above wrappers should work without a problem, I can definitely guarantee that the last one (BitcoinLib) handles raw transactions flawlessly so please follow @apxu's instructions and give it another go.

Thanks

"1) you should not split hex-representation to smaller pieces"

What do you mean by this?  Also the sending address does not exist in the btc wallet of the node im sending from.  I am using blockexplorer to get the collection of utxo's, then creating the signature in c#

The sig seems valid, as it works in the blockchain.info send tx function
apxu
Member
**
Offline Offline

Activity: 229
Merit: 13


View Profile
May 16, 2014, 07:04:18 AM
 #12

Quote
>> 1) you should not split hex-representation to smaller pieces"
What do you mean by this?

Sorry, but I have to say that sending this tx was [possibly] done by me.
I've just copied from this thread your data, pasted it to editor, removed spaces and executed "sendrawtransaction" in bitcoin-qt consone. Oups! It was gone to the network!

May be it is a bug of my browser or this forum engine, but the transaction in editor was splitted and separated by spaces
01000...901000<space>0008B....4F865<space>0221...104C70<space>5D4C....361C

Quote
Also the sending address does not exist in the btc wallet of the node im sending from.  I am using blockexplorer to get the collection of utxo's, then creating the signature in c#

I advise use blank wallet.dat for experiments and restart bitcoind after each try.
Because bitcoind attempts to re-send not confirmed transactions for a while.

For example your first try was to send 0.001 btc from "A" to "B" (spending utxo xxxx:x ) with fee=0
Your local bitcoind passed this tx to network and keeped it in memory-pool
But the transaction was rejected by your peers (reason: dust, not enough fees, low priority etc)
You do not see this tx on network, you see that utxo xxxx:x is uspent,
but now you are not able to spend the same utxo, because your local bitcoind rejects double-spending

Quote
The sig seems valid, as it works in the blockchain.info send tx function
blockchain.info did not receive your first tries

So,
1) backup your existed wallet.dat (several times) [do not forget to shut down bitcoind before it]
2) remove wallet.dat
3) recreate empty wallet.dat - your local bitcoind installation will be only a proxy without keeping db of transactions
4) USE TESTNET. Let me send you some test btc. Just give me address
5) restart bitcoind each time after unsuccessful push tx into network to clear local memory-pool



doof (OP)
Hero Member
*****
Offline Offline

Activity: 765
Merit: 503


View Profile WWW
May 16, 2014, 09:19:30 AM
 #13

test net address mfh6ShtWWoTpYT2daZQKNtjDZq52LhgMw2

not finding any active connections though.
doof (OP)
Hero Member
*****
Offline Offline

Activity: 765
Merit: 503


View Profile WWW
May 16, 2014, 09:21:34 AM
 #14


So,
1) backup your existed wallet.dat (several times) [do not forget to shut down bitcoind before it]
2) remove wallet.dat
3) recreate empty wallet.dat - your local bitcoind installation will be only a proxy without keeping db of transactions
4) USE TESTNET. Let me send you some test btc. Just give me address
5) restart bitcoind each time after unsuccessful push tx into network to clear local memory-pool


I have a few VMs with empty wallets, so backup isn't too important.
apxu
Member
**
Offline Offline

Activity: 229
Merit: 13


View Profile
May 16, 2014, 09:36:03 AM
 #15

hosts from my log
Code:
connected 23.239.17.57:18333
connected 85.153.13.35:18333
connected 162.242.155.221:18333
connected 83.238.60.78:18333
connected 188.226.139.138:18333
connected 184.107.180.2:18333
connected 5.9.2.145:18333

http://test.webbtc.com/tx/fbbba408cf505ea91e639d266f2425ac2ee83702ff7e4431df193b3ee0567177
sent ~50 testbtc to http://test.webbtc.com/address/mfh6ShtWWoTpYT2daZQKNtjDZq52LhgMw2

hope it helps

PS. I do not need testcoins right now and I am ready to share them with everyone who really needs them in testing
doof (OP)
Hero Member
*****
Offline Offline

Activity: 765
Merit: 503


View Profile WWW
May 17, 2014, 11:51:17 AM
 #16

Thanks heaps guys!  Deleting wallet.dat worked!!
Nicolas Dorier
Hero Member
*****
Offline Offline

Activity: 714
Merit: 621


View Profile
May 30, 2014, 03:59:04 PM
 #17

doof, for information

I created https://github.com/NicolasDorier/NBitcoin which has a RPCClient. (available through Nuget)
It is the most complete .NET lib on Bitcoin, and even more complete than BitcoinJ.
Hope it will be useful for you in the future.

Bitcoin address 15sYbVpRh6dyWycZMwPdxJWD4xbfxReeHe
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!