Bitcoin Forum
May 03, 2024, 12:42:51 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: many tiny transaction from mining --> Error: Transaction creation failed  (Read 1281 times)
drakoin (OP)
Hero Member
*****
Offline Offline

Activity: 826
Merit: 1000

see my profile


View Profile
February 26, 2014, 05:54:32 AM
Last edit: February 27, 2014, 04:48:23 AM by drakoin
 #1

EDIT: Solved. See below.

sendmany.sh

Bundle thousands of tiny transactions into dozens of small transactions
to restore the health of a wallet which has been polluted by p2pool microtransactions


This script below sends out many transactions in one go, to the same address.
...

..  .. . . .. . ..  ...... .. .. . . . .. . . ... .. . . . . . . . . . . . .. .. .. . . . . . ..  .. . . ... . ..  .. . . ..  . ..  .
..  .. . . .. . ..  ...... .. .. . . . .. . . ... .. . . . . . . . . . . . .. .. .. . . . . . ..  .. . . ... . ..  .. . . ..  . ..  .
..  .. . . .. . ..  ...... .. .. . . . old posting #1 following now .. .. . . . . . ..  .. . . ... . ..  .. . . ..  . ..  .
..  .. . . .. . ..  ...... .. .. . . . .. . . ... .. . . . . . . . . . . . .. .. .. . . . . . ..  .. . . ... . ..  .. . . ..  . ..  .
..  .. . . .. . ..  ...... .. .. . . . .. . . ... .. . . . . . . . . . . . .. .. .. . . . . . ..  .. . . ... . ..  .. . . ..  . ..  .
.
.

This is probably a well known problem:
https://bitcointalk.org/index.php?topic=397916.msg5378737#msg5378737

Code:
Transaction too large
Code:
Error: Transaction creation failed

How to solve it?

What is the limit?

Where is a script which compiles small amounts to increasingly larger ones?


no sign of a signature
1714696971
Hero Member
*
Offline Offline

Posts: 1714696971

View Profile Personal Message (Offline)

Ignore
1714696971
Reply with quote  #2

1714696971
Report to moderator
Transactions must be included in a block to be properly completed. When you send a transaction, it is broadcast to miners. Miners can then optionally include it in their next blocks. Miners will be more inclined to include your transaction if it has a higher transaction fee.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
drakoin (OP)
Hero Member
*****
Offline Offline

Activity: 826
Merit: 1000

see my profile


View Profile
February 27, 2014, 12:16:24 AM
Last edit: February 27, 2014, 12:54:14 AM by drakoin
 #2

Alright, that was a long day. My C-Notes wallet was very ill.
But I solved the problem, by scripted sending of many transactions - whew. Yiehah!

1) I had won the auction of GRID shares and wanted to send C-Notes for that - but my wallet was suddenly very ill.
2) So I documented the problem in that altcoin thread about C-notes, and asked for help.
3) The existing block explorer does not help to find out what's going on  - we will get a better one.
4) I was almost sure that I had understood the problem, now I was searching for a solution.
5) I searched in many places, then asked for script here, and in pywallet.
6) I could have made a simple Windows Batch script, but the Dev had only compiled the qt-wallet for us, not the really useful headless CLI wallet daemon.
7) What about accessing the wallet through its built-in JSON RPC-Server? (Until today I hadn't used my www browser to look at my wallet, coooool.)
8) But hey - I suddenly thought: For linux I have a CLI client, because I hadcompiled it myself. So I transferred the wallet.dat with PSCP.exe up into the cloud.
9) But then the wallet.dat seemed incompatible. Aaaarrghhh. Learnt a bit about the qt-sourcecode - but I could only get so far without the dev who compiled the windows-qt wallet.
10) In the end the only thing it needed was redownloading the blockchain. Wallet transfer = new blockchain download!
11) Then I could finally start to write that simple script. I am still new to linux-scripting, so I ran into many stupid problems...
12) Wow, I can catch exit code AND programm output: A=$(command parameter); if [ "$?" != "0" ]; then ...
13) I did not expect that subtracting non-integer values could problematic. Didn't get it. Solved it with $(echo $a-$b | bc)
14) But I could not code my strategy: I wanted to send transaction until the final balance was just under the target balance. But I just could not get the while-condition to work for me, probably because of the float values?  My workaround was ... giving up, and instead using a for (( i = 1 ; i <= $3 ; i++ )) loop, and catching the error if the balance would run out.
15) It works. YIIIIEHAAAH! Yeah! Yippieh.
16) With my script I have sent all 2000 tiny funds in a few dozen many small packages to wallet2, and from there in one big transaction back to wallet1.

So here we are. Ready. My wallet is healthy again.

All asking today did not really result in much help. Have I asked in the wrong way, or in the wrong places?
It was as if bitcointalk was empty, and everyone knowledgable on holidays :-)

I solved it alone. And a few other things on the way.  What a learning experience!

Thanks bitcoin, you are some nerdy playground :-)

You like that detective story? My donation address is  BTC 1JLKNFxKjkU3YsLs38y4e672iWiXBeFYP3
or C-Notes CTVHuvvdJj61fC1mzFAQ4V1TrYBb8QTpiA or many other at www.tiny.cc/drakointip

no sign of a signature
fasbit
Sr. Member
****
Offline Offline

Activity: 425
Merit: 253


View Profile
February 27, 2014, 02:28:34 AM
 #3

Alright, that was a long day. My C-Notes wallet was very ill.
But I solved the problem, by scripted sending of many transactions - whew. Yiehah!

1) I had won the auction of GRID shares and wanted to send C-Notes for that - but my wallet was suddenly very ill.
2) So I documented the problem in that altcoin thread about C-notes, and asked for help.
3) The existing block explorer does not help to find out what's going on  - we will get a better one.
4) I was almost sure that I had understood the problem, now I was searching for a solution.
5) I searched in many places, then asked for script here, and in pywallet.
6) I could have made a simple Windows Batch script, but the Dev had only compiled the qt-wallet for us, not the really useful headless CLI wallet daemon.
7) What about accessing the wallet through its built-in JSON RPC-Server? (Until today I hadn't used my www browser to look at my wallet, coooool.)
Cool But hey - I suddenly thought: For linux I have a CLI client, because I hadcompiled it myself. So I transferred the wallet.dat with PSCP.exe up into the cloud.
9) But then the wallet.dat seemed incompatible. Aaaarrghhh. Learnt a bit about the qt-sourcecode - but I could only get so far without the dev who compiled the windows-qt wallet.
10) In the end the only thing it needed was redownloading the blockchain. Wallet transfer = new blockchain download!
11) Then I could finally start to write that simple script. I am still new to linux-scripting, so I ran into many stupid problems...
12) Wow, I can catch exit code AND programm output: A=$(command parameter); if [ "$?" != "0" ]; then ...
13) I did not expect that subtracting non-integer values could problematic. Didn't get it. Solved it with $(echo $a-$b | bc)
14) But I could not code my strategy: I wanted to send transaction until the final balance was just under the target balance. But I just could not get the while-condition to work for me, probably because of the float values?  My workaround was ... giving up, and instead using a for (( i = 1 ; i <= $3 ; i++ )) loop, and catching the error if the balance would run out.
15) It works. YIIIIEHAAAH! Yeah! Yippieh.
16) With my script I have sent all 2000 tiny funds in a few dozen many small packages to wallet2, and from there in one big transaction back to wallet1.

So here we are. Ready. My wallet is healthy again.

All asking today did not really result in much help. Have I asked in the wrong way, or in the wrong places?
It was as if bitcointalk was empty, and everyone knowledgable on holidays :-)

I solved it alone. And a few other things on the way.  What a learning experience!

Thanks bitcoin, you are some nerdy playground :-)

You like that detective story? My donation address is  BTC 1JLKNFxKjkU3YsLs38y4e672iWiXBeFYP3
or C-Notes CTVHuvvdJj61fC1mzFAQ4V1TrYBb8QTpiA or many other at www.tiny.cc/drakointip


The guy who did the Windows installer is "shakazula"  - I dont think he's active any more... he kind of fell off the planet...
drakoin (OP)
Hero Member
*****
Offline Offline

Activity: 826
Merit: 1000

see my profile


View Profile
February 27, 2014, 04:40:47 AM
Last edit: February 13, 2015, 06:47:13 PM by drakoin
 #4

sendmany.sh
Bundle thousands of tiny transactions in dozens of small transactions to restore the health of a wallet which has been polluted by p2pool microtransactions

This script below sends out many transactions in one go, to the same address.
So the tiny incoming transactions are bundled up to small outgoing transactions
which can be sent back as one big transaction. Problem solved.

This is an example in which all goes well with my script and the parameters, using the command:

Code:
./sendmany.sh ~/C-Note/c-noted  CTVHuvvdJj61fC1mzFAQ4V1TrYBb8QTpiA 3 10 BundlingUpSmallTransactions

the output is:

Code:
I will use /root/C-Note/c-noted to send 3 packages of size 10 to CPuubkhAgXG1b1XCVbrt4rCW2E1cWAXokq with message BundlingUpSmallTransactions
Press Ctrl-C if you do NOT want that, or ENTER if you agree... Good. Let us start.
Balance before the action was 51.10549
BEFORE=51.10549000 AFTER=41.10429000 TX-ID=6d828c...
BEFORE=41.10429000 AFTER=31.10299000 TX-ID=bc766b...
BEFORE=31.10299000 AFTER=21.10149000 TX-ID=01059b...
Ready.
In total, including transaction fees, 30.004 were sent.
Balance after all that action now is: 21.10149


If the package size is still too large (and thus would bundle too many tiny transactions into one), like in my case with

Code:
./sendmany.sh ~/C-Note/c-noted CTVHuvvdJj61fC1mzFAQ4V1TrYBb8QTpiA 3 50 BundlingUpSmallTransactions

then the result is like this:

Code:
I will use /root/C-Note/c-noted to send 3 packages of size 50 to CPuubkhAgXG1b1XCVbrt4rCW2E1cWAXokq with message BundlingUpSmallTransactions
Press Ctrl-C if you do NOT want that, or ENTER if you agree... Good. Let us start.
Balance before the action was 144.11369000
error: {"code":-4,"message":"Transaction too large"}
error: {"code":-4,"message":"Transaction too large"}
error: {"code":-4,"message":"Transaction too large"}
Ready.
In total, including transaction fees, 0 were sent.
Balance after all that action now is: 144.11369000


I guess that's it. My script solved my problem. May it solve yours, too.

Here it is: "sendmany.sh" incl short instructions
https://github.com/drakoin/LinuxWallet/blob/master/sendmany.sh



All the problems my script ran into (no daemon there at all, tx still too large, insufficient funds, etc.) are caught now, and should not cause problems anymore. Only the ones that haven't happened, might still cause problems :-) If you run this, read the script before, so that you understand what it does. No guarantees whatsoever. Your own risk.

But still - may it help you  Wink

no sign of a signature
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!