Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: chaord on February 20, 2011, 08:09:21 PM



Title: Patch needed ASAP: 100BTC + 50% for completion in < 24 hrs
Post by: chaord on February 20, 2011, 08:09:21 PM
Hi guys -

I hope someone is in the mood to make a quick buck today.  I need a relatively straight forward patch for the bitcoin client.  Here are the requirements:

  • Add new json-rpc command "broadcastTransactions"
  • Parameters: list of transactions in the same format as a serialized CTransaction.  Note, these transactions are likely NOT belonging to the client's bitcoind wallet.  They were created and serialized by an external wallet.
  • Procedure:  broadcast the new transactions to peers so that it will ultimately be accepted into a block.  i *think* it just needs to get added to the memory pool and then bitcoin will take care of advertising it to other nodes, send it etc.
  • No GUI necessary.  This is purely a headless patch.
If this is something you are capable of doing, I'd really appreciate it.  I'm willing to pay 100BTC for a working patch in 48 hours (50% bonus for < 24 hours).

As always, if you have questions (or if I didn't explain something correctly).  Please ask.  You can reply here, or contact me privately at chaord.btc@gmail.com.

Thanks.

P.S.  I will pay an additional 50% bonus if you can make sure the transactions are not lost in a blockchain re-org.


Title: Re: Patch needed ASAP: 100BTC + 50% for completion in < 24 hrs
Post by: chaord on February 21, 2011, 12:14:02 AM
Alternatively, I would also accept a server-side program (any language) that accomplishes the same thing and simply opens a connection with bitcoind, does the handshake, and sends the transaction.

Any takers?


Title: Re: Patch needed ASAP: 100BTC + 50% for completion in < 24 hrs
Post by: ShadowOfHarbringer on February 21, 2011, 12:22:32 AM
Will this patch be added to the publicly avaiable source, or will it be a secret/closed source ?


Title: Re: Patch needed ASAP: 100BTC + 50% for completion in < 24 hrs
Post by: chaord on February 21, 2011, 12:36:23 AM
Will this patch be added to the publicly avaiable source, or will it be a secret/closed source ?

I'd be happy to opensource this patch.  I eventually plan to open-source everything I'm working on.

I can't speak for the official source-code though.  I suppose if there is enough demand, they'd likely include it or something similar.


Title: Re: Patch needed ASAP: 100BTC + 50% for completion in < 24 hrs
Post by: Hal on February 21, 2011, 10:21:23 PM
Did you ever get this? Here's some minimal code that might work. Add to rpc.cpp after getwork:
Code:
Value broadcasttransactions(const Array& params, bool fHelp)
{
    if (fHelp || params.size() < 1)
        throw runtime_error(
            "broadcasttransactions <hexencodedtransaction> ...\n"
            "Broadcasts specified transaction(s) out onto the network.");

    for(int param=0; param<params.size(); param++)
    {
        string strTx = params[param].get_str();
        CDataStream vMsg(ParseHex(strTx));
        CTransaction tx;
        vMsg >> tx;
        CInv inv(MSG_TX, tx.GetHash());
        RelayMessage(inv, tx);
    }
    return Value::null;
}

Then add at the end of pCallTable (the next code block):
Code:
    make_pair("broadcasttransactions", &broadcasttransactions),

Maybe add "broadcasttransactions" to that next table, pAllowInSafeMode, otherwise I guess you have to start the server with -disablesafemode.

This is untested, I only spent about half an hour on it, so you don't have to pay if you use it.


Title: Re: Patch needed ASAP: 100BTC + 50% for completion in < 24 hrs
Post by: chaord on February 21, 2011, 11:57:59 PM
Hal -
Thanks so much for contributing this.  I'll see if I can get it implemented an tested somehow (I'm not much of a C++ guy, so it'll be interesting).  If it works out, I'll flick you a couple bitcoins for your efforts!  Cheers.
--chaord