7f4eb528caca6675197c3c64e8e71c2f6907f54f
[electrum-server.git] / patches / bitcoin-0.6.2.diff
1 --- main.cpp    2012-06-13 21:40:29.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 @@ -3295,13 +3292,6 @@
30      pblock->nBits          = GetNextWorkRequired(pindexPrev, pblock.get());
31      pblock->nNonce         = 0;
32  
33 -
34 -
35 -    // Electrum: remove from mem pool
36 -    BOOST_FOREACH(CTransaction& tx, pblock->vtx)
37 -      mempool.remove(tx);
38 -
39 -
40      return pblock.release();
41  }
42  
43 --- bitcoinrpc.cpp      2012-06-13 21:37:34.000000000 +0400
44 +++ bitcoinrpc.cpp.orig 2012-05-08 21:34:23.000000000 +0400
45 @@ -1496,45 +1496,7 @@
46      return entry;
47  }
48  
49 -Value importtransaction(const Array& params, bool fHelp)
50 -{
51 -  string hexdump;
52 -  if (fHelp || params.size() != 1 || (hexdump=params[0].get_str()).size()&1)
53 -    throw runtime_error(
54 -            "importtransaction <hexdata>\n"
55 -            "Import an offline transaction to announce it into the network");
56 -
57 -  std::vector<unsigned char> rawtx;
58 -  for (int i=0; i<hexdump.size(); i+=2)
59 -    {
60 -      int v;
61 -      if (sscanf(hexdump.substr(i,2).c_str(), "%x", &v)!=1)
62 -       throw JSONRPCError(-4, "Error in hex data.");
63 -      rawtx.push_back((unsigned char)v);
64 -    }
65 -try
66 -  {
67 -    CDataStream ss(rawtx, SER_NETWORK, PROTOCOL_VERSION);
68 -    CTransaction tx;
69 -    ss >> tx;
70 -    CInv inv(MSG_TX, tx.GetHash());
71 -
72 -    CTxDB txdb("r");
73 -    if(! tx.AcceptToMemoryPool(txdb, true)) throw JSONRPCError(-4, "Transaction not accepted to memory pool.");
74 -    CDataStream msg(rawtx, SER_NETWORK, PROTOCOL_VERSION);
75 -    RelayMessage(inv, msg);
76 -    return tx.GetHash().GetHex();
77 -  }
78 - catch (std::exception& e)
79 -   {
80 -     throw JSONRPCError(-4, "Exception while parsing the transaction data.");
81 -   }
82 -
83 -}
84 -
85 -
86  
87 -  
88  Value backupwallet(const Array& params, bool fHelp)
89  {
90      if (fHelp || params.size() != 1)
91 @@ -2093,7 +2055,6 @@
92      { "listsinceblock",         &listsinceblock,         false },
93      { "dumpprivkey",            &dumpprivkey,            false },
94      { "importprivkey",          &importprivkey,          false },
95 -    { "importtransaction",      &importtransaction,      false },
96  };
97  
98  CRPCTable::CRPCTable()