Merge pull request #463 from TheBlueMatt/encreadme
authorJeff Garzik <jgarzik@exmulti.com>
Wed, 31 Aug 2011 16:32:42 +0000 (09:32 -0700)
committerJeff Garzik <jgarzik@exmulti.com>
Wed, 31 Aug 2011 16:32:42 +0000 (09:32 -0700)
Encryption readme update and minor rpc.cpp fixes

1  2 
src/rpc.cpp

diff --combined src/rpc.cpp
@@@ -552,7 -552,7 +552,7 @@@ Value sendtoaddress(const Array& params
      CRITICAL_BLOCK(pwalletMain->cs_vMasterKey)
      {
          if(pwalletMain->IsLocked())
-             throw JSONRPCError(-14, "Error: The wallet passphrase entered was incorrect.");
+             throw JSONRPCError(-13, "Error: Please enter the wallet passphrase with walletpassphrase first.");
  
          string strError = pwalletMain->SendMoneyToBitcoinAddress(address, nAmount, wtx);
          if (strError != "")
@@@ -827,7 -827,7 +827,7 @@@ Value sendfrom(const Array& params, boo
      CRITICAL_BLOCK(pwalletMain->cs_vMasterKey)
      {
          if(pwalletMain->IsLocked())
-             throw JSONRPCError(-14, "Error: The wallet passphrase entered was incorrect.");
+             throw JSONRPCError(-13, "Error: Please enter the wallet passphrase with walletpassphrase first.");
  
          // Check funds
          int64 nBalance = GetAccountBalance(strAccount, nMinDepth);
@@@ -894,7 -894,7 +894,7 @@@ Value sendmany(const Array& params, boo
      CRITICAL_BLOCK(pwalletMain->cs_vMasterKey)
      {
          if(pwalletMain->IsLocked())
-             throw JSONRPCError(-14, "Error: The wallet passphrase entered was incorrect.");
+             throw JSONRPCError(-13, "Error: Please enter the wallet passphrase with walletpassphrase first.");
  
          // Check funds
          int64 nBalance = GetAccountBalance(strAccount, nMinDepth);
@@@ -1188,8 -1188,7 +1188,8 @@@ Value listtransactions(const Array& par
  
          // Now: iterate backwards until we have nCount items to return:
          TxItems::reverse_iterator it = txByTime.rbegin();
 -        for (std::advance(it, nFrom); it != txByTime.rend(); ++it)
 +        if (txByTime.size() > nFrom) std::advance(it, nFrom);
 +        for (; it != txByTime.rend(); ++it)
          {
              CWalletTx *const pwtx = (*it).second.first;
              if (pwtx != 0)