1 diff -ur bitcoin-0.5.2/src/bitcoinrpc.cpp bitcoin-0.5.2-electrum/src/bitcoinrpc.cpp
2 --- bitcoin-0.5.2/src/bitcoinrpc.cpp 2012-01-06 01:19:29.000000000 +0200
3 +++ bitcoin-0.5.2-electrum/src/bitcoinrpc.cpp 2012-02-16 12:59:03.000000000 +0200
8 +Value importtransaction(const Array& params, bool fHelp)
11 + if (fHelp || params.size() != 1 || (hexdump=params[0].get_str()).size()&1)
12 + throw runtime_error(
13 + "importtransaction <hexdata>\n"
14 + "Import an offline transaction to announce it into the network");
16 + std::vector<unsigned char> rawtx;
17 + for (int i=0; i<hexdump.size(); i+=2)
20 + if (sscanf(hexdump.substr(i,2).c_str(), "%x", &v)!=1)
21 + throw JSONRPCError(-4, "Error in hex data.");
22 + rawtx.push_back((unsigned char)v);
26 + CDataStream ss(rawtx);
29 + CInv inv(MSG_TX, tx.GetHash());
30 + if(! tx.AcceptToMemoryPool(true)) throw JSONRPCError(-4, "Transaction not accepted to memory pool.");
31 + CDataStream msg(rawtx);
32 + RelayMessage(inv, msg);
33 + return tx.GetHash().GetHex();
35 + catch (std::exception& e)
37 + throw JSONRPCError(-4, "Exception while parsing the transaction data.");
45 Value backupwallet(const Array& params, bool fHelp)
47 if (fHelp || params.size() != 1)
49 make_pair("settxfee", &settxfee),
50 make_pair("getmemorypool", &getmemorypool),
51 make_pair("listsinceblock", &listsinceblock),
52 + make_pair("importtransaction", &importtransaction),
54 map<string, rpcfn_type> mapCallTable(pCallTable, pCallTable + sizeof(pCallTable)/sizeof(pCallTable[0]));
56 diff -ur bitcoin-0.5.2/src/main.cpp bitcoin-0.5.2-electrum/src/main.cpp
57 --- bitcoin-0.5.2/src/main.cpp 2012-01-06 01:19:29.000000000 +0200
58 +++ bitcoin-0.5.2-electrum/src/main.cpp 2012-02-16 13:02:55.000000000 +0200
59 @@ -2819,16 +2819,19 @@
62 unsigned int nTxSize = ::GetSerializeSize(tx, SER_NETWORK);
63 - if (nBlockSize + nTxSize >= MAX_BLOCK_SIZE_GEN)
65 + //if (nBlockSize + nTxSize >= MAX_BLOCK_SIZE_GEN)
67 int nTxSigOps = tx.GetSigOpCount();
68 - if (nBlockSigOps + nTxSigOps >= MAX_BLOCK_SIGOPS)
70 + //if (nBlockSigOps + nTxSigOps >= MAX_BLOCK_SIGOPS)
73 // Transaction fee required depends on block size
74 bool fAllowFree = (nBlockSize + nTxSize < 4000 || CTransaction::AllowFree(dPriority));
75 int64 nMinFee = tx.GetMinFee(nBlockSize, fAllowFree);
77 + // Electrum server: do not check fees
80 // Connecting shouldn't fail due to dependency on other memory pool transactions
81 // because we're already processing them in order of dependency
82 map<uint256, CTxIndex> mapTestPoolTmp(mapTestPool);