Merge branch 'master' of https://github.com/sandos/bitcoin into sandos-master
authortcatm <tcatm@gawab.com>
Wed, 23 Feb 2011 00:07:43 +0000 (01:07 +0100)
committertcatm <tcatm@gawab.com>
Wed, 23 Feb 2011 00:07:43 +0000 (01:07 +0100)
1  2 
rpc.cpp

diff --combined rpc.cpp
+++ b/rpc.cpp
@@@ -1015,13 -1015,13 +1015,13 @@@ Value listtransactions(const Array& par
          for (map<uint256, CWalletTx>::iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
          {
              CWalletTx* wtx = &((*it).second);
 -            txByTime.insert(make_pair(wtx->GetTxTime(), TxPair(wtx, 0)));
 +            txByTime.insert(make_pair(wtx->GetTxTime(), TxPair(wtx, (CAccountingEntry*)0)));
          }
          list<CAccountingEntry> acentries;
          walletdb.ListAccountCreditDebit(strAccount, acentries);
          foreach(CAccountingEntry& entry, acentries)
          {
 -            txByTime.insert(make_pair(entry.nTime, TxPair(0, &entry)));
 +            txByTime.insert(make_pair(entry.nTime, TxPair((CWalletTx*)0, &entry)));
          }
  
          // Now: iterate backwards until we have nCount items to return:
@@@ -1710,6 -1710,8 +1710,8 @@@ void ThreadRPCServer2(void* parg
      ip::tcp::endpoint endpoint(bindAddress, GetArg("-rpcport", 8332));
      ip::tcp::acceptor acceptor(io_service, endpoint);
  
+     acceptor.set_option(boost::asio::ip::tcp::acceptor::reuse_address(true));
  #ifdef USE_SSL
      ssl::context context(io_service, ssl::context::sslv23);
      if (fUseSSL)
          map<string, string> mapHeaders;
          string strRequest;
  
 -        boost::thread api_caller(ReadHTTP, ref(stream), ref(mapHeaders), ref(strRequest));
 +        boost::thread api_caller(ReadHTTP, boost::ref(stream), boost::ref(mapHeaders), boost::ref(strRequest));
          if (!api_caller.timed_join(boost::posix_time::seconds(GetArg("-rpctimeout", 30))))
          {   // Timed out:
              acceptor.cancel();