do_dispatch
[electrum-server.git] / patches / bitcoin-0.6.2.diff
1 --- main.cpp    2012-05-24 01:24:54.000000000 +0400
2 +++ main.cpp.orig       2012-05-08 21:34:24.000000000 +0400
3 @@ -3222,21 +3222,18 @@
4  
5              // Size limits
6              unsigned int nTxSize = ::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION);
7 -            //if (nBlockSize + nTxSize >= MAX_BLOCK_SIZE_GEN)
8 -            //    continue;
9 +            if (nBlockSize + nTxSize >= MAX_BLOCK_SIZE_GEN)
10 +                continue;
11  
12              // Legacy limits on sigOps:
13              unsigned int nTxSigOps = tx.GetLegacySigOpCount();
14 -            //if (nBlockSigOps + nTxSigOps >= MAX_BLOCK_SIGOPS)
15 -            //    continue;
16 +            if (nBlockSigOps + nTxSigOps >= MAX_BLOCK_SIGOPS)
17 +                continue;
18  
19              // Transaction fee required depends on block size
20              bool fAllowFree = (nBlockSize + nTxSize < 4000 || CTransaction::AllowFree(dPriority));
21              int64 nMinFee = tx.GetMinFee(nBlockSize, fAllowFree, GMF_BLOCK);
22  
23 -            // Electrum server: do not check fees
24 -            nMinFee = 0;
25 -
26              // Connecting shouldn't fail due to dependency on other memory pool transactions
27              // because we're already processing them in order of dependency
28              map<uint256, CTxIndex> mapTestPoolTmp(mapTestPool);
29 --- bitcoinrpc.cpp      2012-06-10 20:54:28.000000000 +0400
30 +++ bitcoinrpc.cpp.orig 2012-05-08 21:34:23.000000000 +0400
31 @@ -1496,45 +1496,7 @@
32      return entry;
33  }
34  
35 -Value importtransaction(const Array& params, bool fHelp)
36 -{
37 -  string hexdump;
38 -  if (fHelp || params.size() != 1 || (hexdump=params[0].get_str()).size()&1)
39 -    throw runtime_error(
40 -            "importtransaction <hexdata>\n"
41 -            "Import an offline transaction to announce it into the network");
42 -
43 -  std::vector<unsigned char> rawtx;
44 -  for (int i=0; i<hexdump.size(); i+=2)
45 -    {
46 -      int v;
47 -      if (sscanf(hexdump.substr(i,2).c_str(), "%x", &v)!=1)
48 -       throw JSONRPCError(-4, "Error in hex data.");
49 -      rawtx.push_back((unsigned char)v);
50 -    }
51 -try
52 -  {
53 -    CDataStream ss(rawtx, SER_NETWORK, PROTOCOL_VERSION);
54 -    CTransaction tx;
55 -    ss >> tx;
56 -    CInv inv(MSG_TX, tx.GetHash());
57 -
58 -    CTxDB txdb("r");
59 -    if(! tx.AcceptToMemoryPool(txdb, true)) throw JSONRPCError(-4, "Transaction not accepted to memory pool.");
60 -    CDataStream msg(rawtx, SER_NETWORK, PROTOCOL_VERSION);
61 -    RelayMessage(inv, msg);
62 -    return tx.GetHash().GetHex();
63 -  }
64 - catch (std::exception& e)
65 -   {
66 -     throw JSONRPCError(-4, "Exception while parsing the transaction data.");
67 -   }
68 -
69 -}
70 -
71 -
72  
73 -  
74  Value backupwallet(const Array& params, bool fHelp)
75  {
76      if (fHelp || params.size() != 1)
77 @@ -2093,7 +2055,6 @@
78      { "listsinceblock",         &listsinceblock,         false },
79      { "dumpprivkey",            &dumpprivkey,            false },
80      { "importprivkey",          &importprivkey,          false },
81 -    { "importtransaction",      &importtransaction,      false },
82  };
83  
84  CRPCTable::CRPCTable()