aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--contrib/test-patches/temp-revert-1.patch21
-rw-r--r--contrib/test-patches/temp-revert-3.patch34
-rw-r--r--contrib/test-patches/temp-revert-4.patch110
-rw-r--r--doc/release-notes.md77
-rw-r--r--doc/release-process.md10
-rw-r--r--share/pixmaps/bitcoin.icobin353118 -> 68756 bytes
-rw-r--r--share/setup.nsi2
-rw-r--r--src/bitcoinrpc.cpp9
-rw-r--r--src/bitcoinrpc.h2
-rw-r--r--src/clientversion.h6
-rw-r--r--src/init.cpp5
-rw-r--r--src/key.cpp4
-rw-r--r--src/main.cpp23
-rw-r--r--src/qt/locale/bitcoin_ar.ts2
-rw-r--r--src/rpcmining.cpp9
-rw-r--r--src/rpcwallet.cpp14
-rw-r--r--src/test/checkblock_tests.cpp2
-rw-r--r--src/test/rpc_tests.cpp35
-rw-r--r--src/util.h2
19 files changed, 74 insertions, 293 deletions
diff --git a/contrib/test-patches/temp-revert-1.patch b/contrib/test-patches/temp-revert-1.patch
deleted file mode 100644
index a5aec641ce..0000000000
--- a/contrib/test-patches/temp-revert-1.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-commit 4dcc8701ac0eb09d8992d19fb411cee3c9aaf394
-Author: Matt Corallo <git@bluematt.me>
-Date: Sun Mar 24 20:45:44 2013 -0400
-
- Revert "Update unit test to match rule enforcement starts 21 March"
-
- This reverts commit d3e8c6a9d3fad68b0eee4434401ec7b3066399a2.
-
-diff --git a/src/test/checkblock_tests.cpp b/src/test/checkblock_tests.cpp
-index 3cfb6db..e167def 100644
---- a/src/test/checkblock_tests.cpp
-+++ b/src/test/checkblock_tests.cpp
-@@ -52,7 +52,7 @@ BOOST_AUTO_TEST_CASE(May15)
- if (read_block("Mar12Fork.dat", forkingBlock))
- {
- CValidationState state;
-- forkingBlock.nTime = tMay15-1; // Invalidates PoW
-+ BOOST_CHECK(!forkingBlock.CheckBlock(state, true, true));
- BOOST_CHECK(!forkingBlock.CheckBlock(state, false, false));
-
- // After May 15'th, big blocks are OK:
diff --git a/contrib/test-patches/temp-revert-3.patch b/contrib/test-patches/temp-revert-3.patch
deleted file mode 100644
index 5c0775dfa5..0000000000
--- a/contrib/test-patches/temp-revert-3.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-commit ba84709c65b911798ddae1285d807f4cd036990d
-Author: Matt Corallo <git@bluematt.me>
-Date: Sun Mar 24 20:45:56 2013 -0400
-
- Revert "Before 15 May, limit created block size to 500K"
-
- This reverts commit 402f19b64530775a7e4ded025c80d8c16a55e454.
-
-diff --git a/src/main.cpp b/src/main.cpp
-index 22baf0f..51ada0a 100644
---- a/src/main.cpp
-+++ b/src/main.cpp
-@@ -2057,8 +2057,8 @@ bool CBlock::CheckBlock(CValidationState &state, bool fCheckPOW, bool fCheckMerk
- return state.DoS(100, error("CheckBlock() : size limits failed"));
-
- // Special short-term limits to avoid 10,000 BDB lock limit:
-- if (GetBlockTime() >= 1363867200 && // start enforcing 21 March 2013, noon GMT
-- GetBlockTime() < 1368576000) // stop enforcing 15 May 2013 00:00:00
-+ if (GetBlockTime() > 1363039171 && // 11 March 2013, timestamp of block before the big fork
-+ GetBlockTime() < 1368576000) // 15 May 2013 00:00:00
- {
- // Rule is: #unique txids referenced <= 4,500
- // ... to prevent 10,000 BDB lock exhaustion on old clients
-@@ -4155,10 +4155,6 @@ CBlockTemplate* CreateNewBlock(CReserveKey& reservekey)
- // Limit to betweeen 1K and MAX_BLOCK_SIZE-1K for sanity:
- nBlockMaxSize = std::max((unsigned int)1000, std::min((unsigned int)(MAX_BLOCK_SIZE-1000), nBlockMaxSize));
-
-- // Special compatibility rule before 15 May: limit size to 500,000 bytes:
-- if (GetAdjustedTime() < 1368576000)
-- nBlockMaxSize = std::min(nBlockMaxSize, (unsigned int)(MAX_BLOCK_SIZE_GEN));
--
- // How much of the block should be dedicated to high-priority transactions,
- // included regardless of the fees they pay
- unsigned int nBlockPrioritySize = GetArg("-blockprioritysize", 27000);
diff --git a/contrib/test-patches/temp-revert-4.patch b/contrib/test-patches/temp-revert-4.patch
deleted file mode 100644
index f93d7549c0..0000000000
--- a/contrib/test-patches/temp-revert-4.patch
+++ /dev/null
@@ -1,110 +0,0 @@
-commit ca96b88b61f647d4f56d5d06321dda08a43bf92f
-Author: Matt Corallo <git@bluematt.me>
-Date: Sun Mar 24 20:46:01 2013 -0400
-
- Revert "CheckBlock rule until 15-May for 10,000 BDB lock compatibility"
-
- This reverts commit 8c222dca4f961ad13ec64d690134a40d09b20813.
-
-diff --git a/src/main.cpp b/src/main.cpp
-index 51ada0a..9a06dbf 100644
---- a/src/main.cpp
-+++ b/src/main.cpp
-@@ -2056,25 +2056,6 @@ bool CBlock::CheckBlock(CValidationState &state, bool fCheckPOW, bool fCheckMerk
- if (vtx.empty() || vtx.size() > MAX_BLOCK_SIZE || ::GetSerializeSize(*this, SER_NETWORK, PROTOCOL_VERSION) > MAX_BLOCK_SIZE)
- return state.DoS(100, error("CheckBlock() : size limits failed"));
-
-- // Special short-term limits to avoid 10,000 BDB lock limit:
-- if (GetBlockTime() > 1363039171 && // 11 March 2013, timestamp of block before the big fork
-- GetBlockTime() < 1368576000) // 15 May 2013 00:00:00
-- {
-- // Rule is: #unique txids referenced <= 4,500
-- // ... to prevent 10,000 BDB lock exhaustion on old clients
-- set<uint256> setTxIn;
-- for (size_t i = 0; i < vtx.size(); i++)
-- {
-- setTxIn.insert(vtx[i].GetHash());
-- if (i == 0) continue; // skip coinbase txin
-- BOOST_FOREACH(const CTxIn& txin, vtx[i].vin)
-- setTxIn.insert(txin.prevout.hash);
-- }
-- size_t nTxids = setTxIn.size();
-- if (nTxids > 4500)
-- return error("CheckBlock() : 15 May maxlocks violation");
-- }
--
- // Check proof of work matches claimed amount
- if (fCheckPOW && !CheckProofOfWork(GetHash(), nBits))
- return state.DoS(50, error("CheckBlock() : proof of work failed"));
-diff --git a/src/test/checkblock_tests.cpp b/src/test/checkblock_tests.cpp
-deleted file mode 100644
-index e167def..0000000
---- a/src/test/checkblock_tests.cpp
-+++ /dev/null
-@@ -1,66 +0,0 @@
--//
--// Unit tests for block.CheckBlock()
--//
--#include <algorithm>
--
--#include <boost/assign/list_of.hpp> // for 'map_list_of()'
--#include <boost/date_time/posix_time/posix_time_types.hpp>
--#include <boost/test/unit_test.hpp>
--#include <boost/foreach.hpp>
--
--#include "main.h"
--#include "wallet.h"
--#include "net.h"
--#include "util.h"
--
--BOOST_AUTO_TEST_SUITE(CheckBlock_tests)
--
--bool
--read_block(const std::string& filename, CBlock& block)
--{
-- namespace fs = boost::filesystem;
-- fs::path testFile = fs::current_path() / "test" / "data" / filename;
--#ifdef TEST_DATA_DIR
-- if (!fs::exists(testFile))
-- {
-- testFile = fs::path(BOOST_PP_STRINGIZE(TEST_DATA_DIR)) / filename;
-- }
--#endif
-- FILE* fp = fopen(testFile.string().c_str(), "rb");
-- if (!fp) return false;
--
-- fseek(fp, 8, SEEK_SET); // skip msgheader/size
--
-- CAutoFile filein = CAutoFile(fp, SER_DISK, CLIENT_VERSION);
-- if (!filein) return false;
--
-- filein >> block;
--
-- return true;
--}
--
--BOOST_AUTO_TEST_CASE(May15)
--{
-- // Putting a 1MB binary file in the git repository is not a great
-- // idea, so this test is only run if you manually download
-- // test/data/Mar12Fork.dat from
-- // http://sourceforge.net/projects/bitcoin/files/Bitcoin/blockchain/Mar12Fork.dat/download
-- unsigned int tMay15 = 1368576000;
-- SetMockTime(tMay15); // Test as if it was right at May 15
--
-- CBlock forkingBlock;
-- if (read_block("Mar12Fork.dat", forkingBlock))
-- {
-- CValidationState state;
-- BOOST_CHECK(!forkingBlock.CheckBlock(state, true, true));
-- BOOST_CHECK(!forkingBlock.CheckBlock(state, false, false));
--
-- // After May 15'th, big blocks are OK:
-- forkingBlock.nTime = tMay15; // Invalidates PoW
-- BOOST_CHECK(forkingBlock.CheckBlock(state, false, false));
-- }
--
-- SetMockTime(0);
--}
--
--BOOST_AUTO_TEST_SUITE_END()
diff --git a/doc/release-notes.md b/doc/release-notes.md
index 0e0b04bcaa..acaeef1d60 100644
--- a/doc/release-notes.md
+++ b/doc/release-notes.md
@@ -1,80 +1,3 @@
(note: this is a temporary file, to be added-to by anybody, and deleted at
release time)
-Fee Policy changes
-------------------
-
-The default fee for low-priority transactions is lowered from 0.0005 BTC
-(for each 1,000 bytes in the transaction; an average transaction is
-about 500 bytes) to 0.0001 BTC.
-
-Payments (transaction outputs) of 0.543 times the minimum relay fee
-(0.00005430 BTC) are now considered 'non-standard', because storing them
-costs the network more than they are worth and spending them will usually
-cost their owner more in transaction fees than they are worth.
-
-Non-standard transactions are not relayed across the network, are not included
-in blocks by most miners, and will not show up in your wallet until they are
-included in a block.
-
-The default fee policy can be overridden using the -mintxfee and -minrelaytxfee
-command-line options, but note that we intend to replace the hard-coded fees
-with code that automatically calculates and suggests appropriate fees in the
-0.9 release and note that if you set a fee policy significantly different from
-the rest of the network your transactions may never confirm.
-
-Bitcoin-Qt changes
-------------------
-
-- New icon and splash screen
-- Improve reporting of synchronization process
-- Remove hardcoded fee recommendations
-- Improve metadata of executable on MacOSX and Windows
-- Move export button to individual tabs instead of toolbar
-- Add "send coins" command to context menu in address book
-- Add "copy txid" command to copy transaction IDs from transaction overview
-- Save & restore window size and position when showing & hiding window
-- New translations: Arabic (ar), Bosnian (bs), Catalan (ca), Welsh (cy), Esperanto (eo), Interlingua (la), Latvian (lv) and many improvements to current translations
-
-MacOSX:
-
-- OSX support for click-to-pay (bitcoin:) links
-- Fix GUI disappearing problem on MacOSX (issue #1522)
-
-Linux/Unix:
-
-- Copy addresses to middle-mouse-button clipboard
-
-
-Command-line options
---------------------
-
-* `-walletnotify` will call a command on receiving transactions that affect the wallet.
-* `-alertnotify` will call a command on receiving an alert from the network.
-* `-par` now takes a negative number, to leave a certain amount of cores free.
-
-JSON-RPC API changes
---------------------
-
-* `listunspent` now lists account and address infromation.
-* `getinfo` now also returns the time adjustment estimated from your peers.
-* `getpeerinfo` now returns bytessent, bytesrecv and syncnode.
-* `gettxoutsetinfo` returns statistics about the unspent transaction output database.
-* `gettxout` returns information about a specific unspent transaction output.
-
-
-Networking changes
-------------------
-
-* Significant changes to the networking code, reducing latency and memory consumption.
-* Avoid initial block download stalling.
-* Remove IRC seeding support.
-* Performance tweaks.
-* Added testnet DNS seeds.
-
-Wallet compatibility/rescuing
------------------------------
-
-* Cases where wallets cannot be opened in another version/installation should be reduced.
-* `-salvagewallet` now works for encrypted wallets.
-
diff --git a/doc/release-process.md b/doc/release-process.md
index 17d6a089c9..dc2101e1c1 100644
--- a/doc/release-process.md
+++ b/doc/release-process.md
@@ -17,11 +17,11 @@ Release Process
###tag version in git
- git tag -a v0.8.0
+ git tag -a v(new version, e.g. 0.8.0)
###write release notes. git shortlog helps a lot, for example:
- git shortlog --no-merges v0.7.2..v0.8.0
+ git shortlog --no-merges v(current version, e.g. 0.7.2)..v(new version, e.g. 0.8.0)
* * *
@@ -30,7 +30,7 @@ Release Process
From a directory containing the bitcoin source, gitian-builder and gitian.sigs
export SIGNER=(your gitian key, ie bluematt, sipa, etc)
- export VERSION=0.8.0
+ export VERSION=(new version, e.g. 0.8.0)
cd ./gitian-builder
Fetch and build inputs: (first time, or when dependency versions change)
@@ -134,7 +134,7 @@ Commit your signature to gitian.sigs:
From a directory containing bitcoin source, gitian.sigs and gitian zips
- export VERSION=0.5.1
+ export VERSION=(new version, e.g. 0.8.0)
mkdir bitcoin-${VERSION}-linux-gitian
pushd bitcoin-${VERSION}-linux-gitian
unzip ../bitcoin-${VERSION}-linux-gitian.zip
@@ -161,4 +161,4 @@ From a directory containing bitcoin source, gitian.sigs and gitian zips
popd
- Upload gitian zips to SourceForge
-- Celebrate \ No newline at end of file
+- Celebrate
diff --git a/share/pixmaps/bitcoin.ico b/share/pixmaps/bitcoin.ico
index 48a9822a46..f5480f4161 100644
--- a/share/pixmaps/bitcoin.ico
+++ b/share/pixmaps/bitcoin.ico
Binary files differ
diff --git a/share/setup.nsi b/share/setup.nsi
index 3715b46207..d5f2ffc3f8 100644
--- a/share/setup.nsi
+++ b/share/setup.nsi
@@ -51,7 +51,7 @@ CRCCheck on
XPStyle on
BrandingText " "
ShowInstDetails show
-VIProductVersion 0.8.2.1
+VIProductVersion 0.8.2.2
VIAddVersionKey ProductName Bitcoin
VIAddVersionKey ProductVersion "${VERSION}"
VIAddVersionKey CompanyName "${COMPANY}"
diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp
index a9b73fd5a6..2c4744a579 100644
--- a/src/bitcoinrpc.cpp
+++ b/src/bitcoinrpc.cpp
@@ -30,6 +30,10 @@ using namespace boost;
using namespace boost::asio;
using namespace json_spirit;
+// Key used by getwork/getblocktemplate miners.
+// Allocated in StartRPCThreads, free'd in StopRPCThreads
+CReserveKey* pMiningKey = NULL;
+
static std::string strRPCUserColonPass;
// These are created by StartRPCThreads, destroyed in StopRPCThreads
@@ -722,6 +726,9 @@ static void RPCAcceptHandler(boost::shared_ptr< basic_socket_acceptor<Protocol,
void StartRPCThreads()
{
+ // getwork/getblocktemplate mining rewards paid here:
+ pMiningKey = new CReserveKey(pwalletMain);
+
strRPCUserColonPass = mapArgs["-rpcuser"] + ":" + mapArgs["-rpcpassword"];
if ((mapArgs["-rpcpassword"] == "") ||
(mapArgs["-rpcuser"] == mapArgs["-rpcpassword"]))
@@ -841,6 +848,8 @@ void StartRPCThreads()
void StopRPCThreads()
{
+ delete pMiningKey; pMiningKey = NULL;
+
if (rpc_io_service == NULL) return;
rpc_io_service->stop();
diff --git a/src/bitcoinrpc.h b/src/bitcoinrpc.h
index 315fd92383..cf5b137988 100644
--- a/src/bitcoinrpc.h
+++ b/src/bitcoinrpc.h
@@ -11,6 +11,7 @@
#include <map>
class CBlockIndex;
+class CReserveKey;
#include "json/json_spirit_reader_template.h"
#include "json/json_spirit_writer_template.h"
@@ -122,6 +123,7 @@ public:
};
extern const CRPCTable tableRPC;
+extern CReserveKey* pMiningKey;
extern int64 nWalletUnlockTime;
extern int64 AmountFromValue(const json_spirit::Value& value);
diff --git a/src/clientversion.h b/src/clientversion.h
index aabab4c726..30c0c4072b 100644
--- a/src/clientversion.h
+++ b/src/clientversion.h
@@ -8,11 +8,11 @@
// These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it
#define CLIENT_VERSION_MAJOR 0
#define CLIENT_VERSION_MINOR 8
-#define CLIENT_VERSION_REVISION 2
-#define CLIENT_VERSION_BUILD 1
+#define CLIENT_VERSION_REVISION 99
+#define CLIENT_VERSION_BUILD 0
// Set to true for release, false for prerelease or test build
-#define CLIENT_VERSION_IS_RELEASE true
+#define CLIENT_VERSION_IS_RELEASE false
// Copyright year (2009-this)
// Todo: update this when changing our copyright comments in the source
diff --git a/src/init.cpp b/src/init.cpp
index 6dafcc4af0..2175f73d70 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -101,7 +101,8 @@ void Shutdown()
StopNode();
{
LOCK(cs_main);
- pwalletMain->SetBestChain(CBlockLocator(pindexBest));
+ if (pwalletMain)
+ pwalletMain->SetBestChain(CBlockLocator(pindexBest));
if (pblocktree)
pblocktree->Flush();
if (pcoinsTip)
@@ -532,7 +533,7 @@ bool AppInit2(boost::thread_group& threadGroup)
// Make sure enough file descriptors are available
int nBind = std::max((int)mapArgs.count("-bind"), 1);
nMaxConnections = GetArg("-maxconnections", 125);
- nMaxConnections = std::max(std::min(nMaxConnections, FD_SETSIZE - nBind - MIN_CORE_FILEDESCRIPTORS), 0);
+ nMaxConnections = std::max(std::min(nMaxConnections, (int)(FD_SETSIZE - nBind - MIN_CORE_FILEDESCRIPTORS)), 0);
int nFD = RaiseFileDescriptorLimit(nMaxConnections + MIN_CORE_FILEDESCRIPTORS);
if (nFD < MIN_CORE_FILEDESCRIPTORS)
return InitError(_("Not enough file descriptors available."));
diff --git a/src/key.cpp b/src/key.cpp
index 20114e6bb2..75114c6afe 100644
--- a/src/key.cpp
+++ b/src/key.cpp
@@ -328,7 +328,10 @@ bool CKey::SignCompact(uint256 hash, std::vector<unsigned char>& vchSig)
}
if (nRecId == -1)
+ {
+ ECDSA_SIG_free(sig);
throw key_error("CKey::SignCompact() : unable to construct recoverable key");
+ }
vchSig[0] = nRecId+27+(fCompressedPubKey ? 4 : 0);
BN_bn2bin(sig->r,&vchSig[33-(nBitsR+7)/8]);
@@ -367,6 +370,7 @@ bool CKey::SetCompactSignature(uint256 hash, const std::vector<unsigned char>& v
ECDSA_SIG_free(sig);
return true;
}
+ ECDSA_SIG_free(sig);
return false;
}
diff --git a/src/main.cpp b/src/main.cpp
index b7efac53b1..a03921e9b5 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -2073,25 +2073,6 @@ bool CBlock::CheckBlock(CValidationState &state, bool fCheckPOW, bool fCheckMerk
if (vtx.empty() || vtx.size() > MAX_BLOCK_SIZE || ::GetSerializeSize(*this, SER_NETWORK, PROTOCOL_VERSION) > MAX_BLOCK_SIZE)
return state.DoS(100, error("CheckBlock() : size limits failed"));
- // Special short-term limits to avoid 10,000 BDB lock limit:
- if (GetBlockTime() >= 1363867200 && // start enforcing 21 March 2013, noon GMT
- GetBlockTime() < 1368576000) // stop enforcing 15 May 2013 00:00:00
- {
- // Rule is: #unique txids referenced <= 4,500
- // ... to prevent 10,000 BDB lock exhaustion on old clients
- set<uint256> setTxIn;
- for (size_t i = 0; i < vtx.size(); i++)
- {
- setTxIn.insert(vtx[i].GetHash());
- if (i == 0) continue; // skip coinbase txin
- BOOST_FOREACH(const CTxIn& txin, vtx[i].vin)
- setTxIn.insert(txin.prevout.hash);
- }
- size_t nTxids = setTxIn.size();
- if (nTxids > 4500)
- return error("CheckBlock() : 15 May maxlocks violation");
- }
-
// Check proof of work matches claimed amount
if (fCheckPOW && !CheckProofOfWork(GetHash(), nBits))
return state.DoS(50, error("CheckBlock() : proof of work failed"));
@@ -4188,10 +4169,6 @@ CBlockTemplate* CreateNewBlock(CReserveKey& reservekey)
// Limit to betweeen 1K and MAX_BLOCK_SIZE-1K for sanity:
nBlockMaxSize = std::max((unsigned int)1000, std::min((unsigned int)(MAX_BLOCK_SIZE-1000), nBlockMaxSize));
- // Special compatibility rule before 15 May: limit size to 500,000 bytes:
- if (GetAdjustedTime() < 1368576000)
- nBlockMaxSize = std::min(nBlockMaxSize, (unsigned int)(MAX_BLOCK_SIZE_GEN));
-
// How much of the block should be dedicated to high-priority transactions,
// included regardless of the fees they pay
unsigned int nBlockPrioritySize = GetArg("-blockprioritysize", 27000);
diff --git a/src/qt/locale/bitcoin_ar.ts b/src/qt/locale/bitcoin_ar.ts
index 028080d545..741a25a4da 100644
--- a/src/qt/locale/bitcoin_ar.ts
+++ b/src/qt/locale/bitcoin_ar.ts
@@ -38,7 +38,7 @@ This product includes software developed by the OpenSSL Project for use in the O
<message>
<location filename="../forms/addressbookpage.ui" line="+14"/>
<source>Address Book</source>
- <translation>كتاب العنوانين</translation>
+ <translation>دفتر العناوين</translation>
</message>
<message>
<location line="+19"/>
diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp
index fddda8b5f4..b8b7459634 100644
--- a/src/rpcmining.cpp
+++ b/src/rpcmining.cpp
@@ -104,7 +104,6 @@ Value getwork(const Array& params, bool fHelp)
typedef map<uint256, pair<CBlock*, CScript> > mapNewBlock_t;
static mapNewBlock_t mapNewBlock; // FIXME: thread safety
static vector<CBlockTemplate*> vNewBlockTemplate;
- static CReserveKey reservekey(pwalletMain);
if (params.size() == 0)
{
@@ -134,7 +133,7 @@ Value getwork(const Array& params, bool fHelp)
nStart = GetTime();
// Create new block
- pblocktemplate = CreateNewBlock(reservekey);
+ pblocktemplate = CreateNewBlock(*pMiningKey);
if (!pblocktemplate)
throw JSONRPCError(RPC_OUT_OF_MEMORY, "Out of memory");
vNewBlockTemplate.push_back(pblocktemplate);
@@ -192,7 +191,7 @@ Value getwork(const Array& params, bool fHelp)
pblock->vtx[0].vin[0].scriptSig = mapNewBlock[pdata->hashMerkleRoot].second;
pblock->hashMerkleRoot = pblock->BuildMerkleTree();
- return CheckWork(pblock, *pwalletMain, reservekey);
+ return CheckWork(pblock, *pwalletMain, *pMiningKey);
}
}
@@ -243,8 +242,6 @@ Value getblocktemplate(const Array& params, bool fHelp)
if (IsInitialBlockDownload())
throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, "Bitcoin is downloading blocks...");
- static CReserveKey reservekey(pwalletMain);
-
// Update block
static unsigned int nTransactionsUpdatedLast;
static CBlockIndex* pindexPrev;
@@ -267,7 +264,7 @@ Value getblocktemplate(const Array& params, bool fHelp)
delete pblocktemplate;
pblocktemplate = NULL;
}
- pblocktemplate = CreateNewBlock(reservekey);
+ pblocktemplate = CreateNewBlock(*pMiningKey);
if (!pblocktemplate)
throw JSONRPCError(RPC_OUT_OF_MEMORY, "Out of memory");
diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp
index 5fd400c6bb..e156469d11 100644
--- a/src/rpcwallet.cpp
+++ b/src/rpcwallet.cpp
@@ -811,6 +811,7 @@ struct tallyitem
{
int64 nAmount;
int nConf;
+ vector<uint256> txids;
tallyitem()
{
nAmount = 0;
@@ -852,6 +853,7 @@ Value ListReceived(const Array& params, bool fByAccounts)
tallyitem& item = mapTally[address];
item.nAmount += txout.nValue;
item.nConf = min(item.nConf, nDepth);
+ item.txids.push_back(wtx.GetHash());
}
}
@@ -887,6 +889,15 @@ Value ListReceived(const Array& params, bool fByAccounts)
obj.push_back(Pair("account", strAccount));
obj.push_back(Pair("amount", ValueFromAmount(nAmount)));
obj.push_back(Pair("confirmations", (nConf == std::numeric_limits<int>::max() ? 0 : nConf)));
+ Array transactions;
+ if (it != mapTally.end())
+ {
+ BOOST_FOREACH(const uint256& item, (*it).second.txids)
+ {
+ transactions.push_back(item.GetHex());
+ }
+ }
+ obj.push_back(Pair("txids", transactions));
ret.push_back(obj);
}
}
@@ -919,7 +930,8 @@ Value listreceivedbyaddress(const Array& params, bool fHelp)
" \"address\" : receiving address\n"
" \"account\" : the account of the receiving address\n"
" \"amount\" : total amount received by the address\n"
- " \"confirmations\" : number of confirmations of the most recent transaction included");
+ " \"confirmations\" : number of confirmations of the most recent transaction included\n"
+ " \"txids\" : list of transactions with outputs to the address\n");
return ListReceived(params, false);
}
diff --git a/src/test/checkblock_tests.cpp b/src/test/checkblock_tests.cpp
index 3cfb6dbfa4..d626f9a6f4 100644
--- a/src/test/checkblock_tests.cpp
+++ b/src/test/checkblock_tests.cpp
@@ -52,8 +52,6 @@ BOOST_AUTO_TEST_CASE(May15)
if (read_block("Mar12Fork.dat", forkingBlock))
{
CValidationState state;
- forkingBlock.nTime = tMay15-1; // Invalidates PoW
- BOOST_CHECK(!forkingBlock.CheckBlock(state, false, false));
// After May 15'th, big blocks are OK:
forkingBlock.nTime = tMay15; // Invalidates PoW
diff --git a/src/test/rpc_tests.cpp b/src/test/rpc_tests.cpp
index f8fe443b87..35eabed0e2 100644
--- a/src/test/rpc_tests.cpp
+++ b/src/test/rpc_tests.cpp
@@ -79,23 +79,44 @@ static Value CallRPC(string args)
}
}
-BOOST_AUTO_TEST_CASE(rpc_rawparams)
+BOOST_AUTO_TEST_CASE(rpc_wallet)
{
- // Test raw transaction API argument handling
+ // Test RPC calls for various wallet statistics
Value r;
- BOOST_CHECK_THROW(CallRPC("getrawtransaction"), runtime_error);
- BOOST_CHECK_THROW(CallRPC("getrawtransaction not_hex"), runtime_error);
- BOOST_CHECK_THROW(CallRPC("getrawtransaction a3b807410df0b60fcb9736768df5823938b2f838694939ba45f3c0a1bff150ed not_int"), runtime_error);
-
BOOST_CHECK_NO_THROW(CallRPC("listunspent"));
BOOST_CHECK_THROW(CallRPC("listunspent string"), runtime_error);
BOOST_CHECK_THROW(CallRPC("listunspent 0 string"), runtime_error);
BOOST_CHECK_THROW(CallRPC("listunspent 0 1 not_array"), runtime_error);
+ BOOST_CHECK_THROW(CallRPC("listunspent 0 1 [] extra"), runtime_error);
BOOST_CHECK_NO_THROW(r=CallRPC("listunspent 0 1 []"));
- BOOST_CHECK_THROW(r=CallRPC("listunspent 0 1 [] extra"), runtime_error);
BOOST_CHECK(r.get_array().empty());
+ BOOST_CHECK_NO_THROW(CallRPC("listreceivedbyaddress"));
+ BOOST_CHECK_NO_THROW(CallRPC("listreceivedbyaddress 0"));
+ BOOST_CHECK_THROW(CallRPC("listreceivedbyaddress not_int"), runtime_error);
+ BOOST_CHECK_THROW(CallRPC("listreceivedbyaddress 0 not_bool"), runtime_error);
+ BOOST_CHECK_NO_THROW(CallRPC("listreceivedbyaddress 0 true"));
+ BOOST_CHECK_THROW(CallRPC("listreceivedbyaddress 0 true extra"), runtime_error);
+
+ BOOST_CHECK_NO_THROW(CallRPC("listreceivedbyaccount"));
+ BOOST_CHECK_NO_THROW(CallRPC("listreceivedbyaccount 0"));
+ BOOST_CHECK_THROW(CallRPC("listreceivedbyaccount not_int"), runtime_error);
+ BOOST_CHECK_THROW(CallRPC("listreceivedbyaccount 0 not_bool"), runtime_error);
+ BOOST_CHECK_NO_THROW(CallRPC("listreceivedbyaccount 0 true"));
+ BOOST_CHECK_THROW(CallRPC("listreceivedbyaccount 0 true extra"), runtime_error);
+}
+
+
+BOOST_AUTO_TEST_CASE(rpc_rawparams)
+{
+ // Test raw transaction API argument handling
+ Value r;
+
+ BOOST_CHECK_THROW(CallRPC("getrawtransaction"), runtime_error);
+ BOOST_CHECK_THROW(CallRPC("getrawtransaction not_hex"), runtime_error);
+ BOOST_CHECK_THROW(CallRPC("getrawtransaction a3b807410df0b60fcb9736768df5823938b2f838694939ba45f3c0a1bff150ed not_int"), runtime_error);
+
BOOST_CHECK_THROW(CallRPC("createrawtransaction"), runtime_error);
BOOST_CHECK_THROW(CallRPC("createrawtransaction null null"), runtime_error);
BOOST_CHECK_THROW(CallRPC("createrawtransaction not_array"), runtime_error);
diff --git a/src/util.h b/src/util.h
index 3d25364505..51a694483a 100644
--- a/src/util.h
+++ b/src/util.h
@@ -7,6 +7,8 @@
#include "uint256.h"
+#include <stdarg.h>
+
#ifndef WIN32
#include <sys/types.h>
#include <sys/time.h>