Author

Topic: How to disable or break TX push when using sendtoaddress? (Read 654 times)

sr. member
Activity: 412
Merit: 287
I'm not so sure on python! but since you're already hacking bitcoind you're probably on the right track. Maybe create a duplicate of sendtoaddress that only returns the raw transaction?

Otherwise you're right, you'd have to do a lot of coding yourself just to piece together essentially the same thing bitcoind does.
newbie
Activity: 12
Merit: 0
What language are you writing your code in? You can just use the raw transaction api without tinkering with the source code?

I am using Python and yes, indeed, I can use raw transactions but the advantage of the sendtoaddress function is it automatically takes care of combining inputs, handling fees, and setting up outputs for change. That is tedious work I might get wrong if I try re-implement. I am currently making progress with hacking Bitcoin not to send the transaction. It involves setting connect=127.0.0.1 in the config, killing the daemon after the sendtoaddress and then removing the database entry. Bitcoin can't send the transaction like this but still returns a TX ID. It's kind of worse than just manually implementing sendtoaddress so I probably won't be using this.

Do you know of any good libraries that might help replicate sendtoaddress?
sr. member
Activity: 412
Merit: 287
What language are you writing your code in? You can just use the raw transaction api without tinkering with the source code?
newbie
Activity: 12
Merit: 0
I am in the process of writing some code at the moment and I'm looking for a way to use the official Bitcoin client for as much of this as possible. Basically, I would like to find a way to return a raw transaction representing the result from executing a JSON-RPC sendtoaddress call but without sending the actual transaction. As far as I can tell, the Bitcoind's API doesn't support this, but there might yet be a way to programmatically break the daemon and convince Bitcoin the TX was sent when it wasn't. Perhaps by manipulating connected peers? Actually I don't even need the raw transaction. I just need the transaction ID and a guarantee the transaction it was derived from hasn't been sent.

Any help would be appreciated Wink
Jump to: