diff --git a/doc/README b/doc/README index 9fe0a44a..5fd4171b 100644 --- a/doc/README +++ b/doc/README @@ -2,7 +2,7 @@ Bitcoin 0.5.6 BETA Copyright (c) 2009-2012 Bitcoin Developers Distributed under the MIT/X11 software license, see the accompanying -file license.txt or http://www.opensource.org/licenses/mit-license.php. +file COPYING or http://www.opensource.org/licenses/mit-license.php. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/). This product includes cryptographic software written by Eric Young (eay@cryptsoft.com). diff --git a/doc/build-osx.txt b/doc/build-osx.txt index f06df50e..674654df 100644 --- a/doc/build-osx.txt +++ b/doc/build-osx.txt @@ -1,6 +1,6 @@ Copyright (c) 2011 Bitcoin Developers Distributed under the MIT/X11 software license, see the accompanying file -license.txt or http://www.opensource.org/licenses/mit-license.php. This +COPYING or http://www.opensource.org/licenses/mit-license.php. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/). This product includes cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by diff --git a/doc/build-unix.txt b/doc/build-unix.txt index 565b191c..191c2f28 100644 --- a/doc/build-unix.txt +++ b/doc/build-unix.txt @@ -1,7 +1,7 @@ Copyright (c) 2009-2010 Satoshi Nakamoto Copyright (c) 2011 Bitcoin Developers Distributed under the MIT/X11 software license, see the accompanying -file license.txt or http://www.opensource.org/licenses/mit-license.php. +file COPYING or http://www.opensource.org/licenses/mit-license.php. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/). This product includes cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP diff --git a/doc/unit-tests.txt b/doc/unit-tests.txt index 1168de7b..671ec3e7 100644 --- a/doc/unit-tests.txt +++ b/doc/unit-tests.txt @@ -1,4 +1,4 @@ -Compiling/runing bitcoind unit tests +Compiling/running bitcoind unit tests ------------------------------------ bitcoind unit tests are in the src/test/ directory; they diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp index 55ad1198..60852a27 100644 --- a/src/bitcoinrpc.cpp +++ b/src/bitcoinrpc.cpp @@ -1660,8 +1660,13 @@ Value getwork(const Array& params, bool fHelp) delete pblock; vNewBlock.clear(); } + + // Clear pindexPrev so future getworks make a new block, despite any failures from here on + pindexPrev = NULL; + + // Store the pindexBest used before CreateNewBlock, to avoid races nTransactionsUpdatedLast = nTransactionsUpdated; - pindexPrev = pindexBest; + CBlockIndex* pindexPrevNew = pindexBest; nStart = GetTime(); // Create new block @@ -1669,6 +1674,9 @@ Value getwork(const Array& params, bool fHelp) if (!pblock) throw JSONRPCError(-7, "Out of memory"); vNewBlock.push_back(pblock); + + // Need to update only after we know CreateNewBlock succeeded + pindexPrev = pindexPrevNew; } // Update nTime