1 diff -ur bitcoin-0.6.0/src/bitcoinrpc.cpp bitcoin-0.6.0-electrum/src/bitcoinrpc.cpp
2 --- bitcoin-0.6.0/src/bitcoinrpc.cpp 2012-03-29 22:11:04.000000000 +0300
3 +++ bitcoin-0.6.0-electrum/src/bitcoinrpc.cpp 2012-03-31 12:30:50.631339067 +0300
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("getmemorypool", &getmemorypool),
50 make_pair("listsinceblock", &listsinceblock),
51 make_pair("dumpprivkey", &dumpprivkey),
52 - make_pair("importprivkey", &importprivkey)
53 + make_pair("importprivkey", &importprivkey),
54 + make_pair("importtransaction", &importtransaction)
56 map<string, rpcfn_type> mapCallTable(pCallTable, pCallTable + sizeof(pCallTable)/sizeof(pCallTable[0]));
58 diff -ur bitcoin-0.6.0/src/main.cpp bitcoin-0.6.0-electrum/src/main.cpp
59 --- bitcoin-0.6.0/src/main.cpp 2012-03-29 22:11:04.000000000 +0300
60 +++ bitcoin-0.6.0-electrum/src/main.cpp 2012-03-31 12:36:41.711339168 +0300
61 @@ -3164,18 +3164,21 @@
64 unsigned int nTxSize = ::GetSerializeSize(tx, SER_NETWORK);
65 - if (nBlockSize + nTxSize >= MAX_BLOCK_SIZE_GEN)
67 + //if (nBlockSize + nTxSize >= MAX_BLOCK_SIZE_GEN)
70 // Legacy limits on sigOps:
71 int nTxSigOps = tx.GetLegacySigOpCount();
72 - if (nBlockSigOps + nTxSigOps >= MAX_BLOCK_SIGOPS)
74 + //if (nBlockSigOps + nTxSigOps >= MAX_BLOCK_SIGOPS)
77 // Transaction fee required depends on block size
78 bool fAllowFree = (nBlockSize + nTxSize < 4000 || CTransaction::AllowFree(dPriority));
79 int64 nMinFee = tx.GetMinFee(nBlockSize, fAllowFree, GMF_BLOCK);
81 + // Electrum server: do not check fees
84 // Connecting shouldn't fail due to dependency on other memory pool transactions
85 // because we're already processing them in order of dependency
86 map<uint256, CTxIndex> mapTestPoolTmp(mapTestPool);