From b2120e223a9a2282b26080cb126db9aad95b1282 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Tue, 9 Aug 2011 13:27:58 +0200 Subject: [PATCH 1/2] Unify copyright notices. To a variation on: // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2011 The Bitcoin developers --- src/base58.h | 1 + src/bignum.h | 1 + src/db.cpp | 1 + src/db.h | 1 + src/headers.h | 1 + src/init.cpp | 1 + src/init.h | 1 + src/irc.cpp | 1 + src/irc.h | 1 + src/key.h | 1 + src/keystore.cpp | 3 ++- src/keystore.h | 3 ++- src/main.cpp | 1 + src/main.h | 1 + src/net.cpp | 1 + src/net.h | 1 + src/noui.h | 1 + src/rpc.cpp | 1 + src/rpc.h | 1 + src/script.cpp | 1 + src/script.h | 1 + src/serialize.h | 1 + src/ui.cpp | 1 + src/ui.h | 1 + src/uint256.h | 1 + src/util.cpp | 1 + src/util.h | 1 + src/wallet.cpp | 3 ++- src/wallet.h | 3 ++- 29 files changed, 33 insertions(+), 4 deletions(-) diff --git a/src/base58.h b/src/base58.h index 04922c74d..592756ff7 100644 --- a/src/base58.h +++ b/src/base58.h @@ -1,4 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2011 The Bitcoin Developers // Distributed under the MIT/X11 software license, see the accompanying // file license.txt or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/bignum.h b/src/bignum.h index 5eaa4028b..1a2406b93 100644 --- a/src/bignum.h +++ b/src/bignum.h @@ -1,4 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2011 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file license.txt or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_BIGNUM_H diff --git a/src/db.cpp b/src/db.cpp index 9c8c9c4f7..b1c99a03f 100644 --- a/src/db.cpp +++ b/src/db.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2011 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file license.txt or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/db.h b/src/db.h index 049857b3a..73ea1902c 100644 --- a/src/db.h +++ b/src/db.h @@ -1,4 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2011 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file license.txt or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_DB_H diff --git a/src/headers.h b/src/headers.h index d1844eb24..d0c743482 100644 --- a/src/headers.h +++ b/src/headers.h @@ -1,4 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2011 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file license.txt or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/init.cpp b/src/init.cpp index acfcc44d1..dbc2c4133 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2011 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file license.txt or http://www.opensource.org/licenses/mit-license.php. #include "headers.h" diff --git a/src/init.h b/src/init.h index a02260c29..4017f2570 100644 --- a/src/init.h +++ b/src/init.h @@ -1,4 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2011 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file license.txt or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_INIT_H diff --git a/src/irc.cpp b/src/irc.cpp index cde934e80..5278488dc 100644 --- a/src/irc.cpp +++ b/src/irc.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2011 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file license.txt or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/irc.h b/src/irc.h index 18e53597f..6945b2cec 100644 --- a/src/irc.h +++ b/src/irc.h @@ -1,4 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2011 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file license.txt or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_IRC_H diff --git a/src/key.h b/src/key.h index 3c14cfedd..4c7f9baf9 100644 --- a/src/key.h +++ b/src/key.h @@ -1,4 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2011 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file license.txt or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_KEY_H diff --git a/src/keystore.cpp b/src/keystore.cpp index 1828d6ddd..4c6848b47 100644 --- a/src/keystore.cpp +++ b/src/keystore.cpp @@ -1,4 +1,5 @@ -// Copyright (c) 2009-2011 Satoshi Nakamoto & Bitcoin developers +// Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2011 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file license.txt or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/keystore.h b/src/keystore.h index 436053a9e..0324cc6e1 100644 --- a/src/keystore.h +++ b/src/keystore.h @@ -1,4 +1,5 @@ -// Copyright (c) 2009-2011 Satoshi Nakamoto & Bitcoin developers +// Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2011 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file license.txt or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_KEYSTORE_H diff --git a/src/main.cpp b/src/main.cpp index b57974f57..289c295b8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2011 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file license.txt or http://www.opensource.org/licenses/mit-license.php. #include "headers.h" diff --git a/src/main.h b/src/main.h index 9d6de52fa..97a40d3ec 100644 --- a/src/main.h +++ b/src/main.h @@ -1,4 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2011 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file license.txt or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_MAIN_H diff --git a/src/net.cpp b/src/net.cpp index d69778821..2bb215668 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2011 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file license.txt or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/net.h b/src/net.h index 78055bfc6..ce41226f6 100644 --- a/src/net.h +++ b/src/net.h @@ -1,4 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2011 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file license.txt or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_NET_H diff --git a/src/noui.h b/src/noui.h index d0072df7f..cbe6fa4c7 100644 --- a/src/noui.h +++ b/src/noui.h @@ -1,4 +1,5 @@ // Copyright (c) 2010 Satoshi Nakamoto +// Copyright (c) 2011 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file license.txt or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_NOUI_H diff --git a/src/rpc.cpp b/src/rpc.cpp index a4deece6b..d62a0d9ac 100644 --- a/src/rpc.cpp +++ b/src/rpc.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2010 Satoshi Nakamoto +// Copyright (c) 2011 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file license.txt or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/rpc.h b/src/rpc.h index 48a7b8a8a..f26740079 100644 --- a/src/rpc.h +++ b/src/rpc.h @@ -1,4 +1,5 @@ // Copyright (c) 2010 Satoshi Nakamoto +// Copyright (c) 2011 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file license.txt or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/script.cpp b/src/script.cpp index 0fc4611fd..d0c6a1149 100644 --- a/src/script.cpp +++ b/src/script.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2011 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file license.txt or http://www.opensource.org/licenses/mit-license.php. #include "headers.h" diff --git a/src/script.h b/src/script.h index 9d94e3f5c..f866dde71 100644 --- a/src/script.h +++ b/src/script.h @@ -1,4 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2011 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file license.txt or http://www.opensource.org/licenses/mit-license.php. #ifndef H_BITCOIN_SCRIPT diff --git a/src/serialize.h b/src/serialize.h index cb3a3ea03..c183d4b38 100644 --- a/src/serialize.h +++ b/src/serialize.h @@ -1,4 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2011 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file license.txt or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_SERIALIZE_H diff --git a/src/ui.cpp b/src/ui.cpp index c3c234439..372808f1a 100644 --- a/src/ui.cpp +++ b/src/ui.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2011 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file license.txt or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/ui.h b/src/ui.h index 3bf741534..2a128a7ba 100644 --- a/src/ui.h +++ b/src/ui.h @@ -1,4 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2011 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file license.txt or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_UI_H diff --git a/src/uint256.h b/src/uint256.h index 14feb1683..3e2020138 100644 --- a/src/uint256.h +++ b/src/uint256.h @@ -1,4 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2011 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file license.txt or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_UINT256_H diff --git a/src/util.cpp b/src/util.cpp index 7693aaa52..1784448fc 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2011 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file license.txt or http://www.opensource.org/licenses/mit-license.php. #include "headers.h" diff --git a/src/util.h b/src/util.h index 8588201da..77f08d747 100644 --- a/src/util.h +++ b/src/util.h @@ -1,4 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2011 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file license.txt or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_UTIL_H diff --git a/src/wallet.cpp b/src/wallet.cpp index 1f3f44bfa..6519ac637 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -1,4 +1,5 @@ -// Copyright (c) 2009-2011 Satoshi Nakamoto & Bitcoin developers +// Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2011 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file license.txt or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/wallet.h b/src/wallet.h index 51dfa5df5..499f2a63a 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -1,4 +1,5 @@ -// Copyright (c) 2009-2011 Satoshi Nakamoto & Bitcoin developers +// Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2011 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file license.txt or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_WALLET_H From eb72eae304a7067eb568437c66c4d831b075dab9 Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Fri, 12 Aug 2011 15:39:12 -0400 Subject: [PATCH 2/2] Don't std::advance past beginning of transactions array. Fixes #465 --- src/rpc.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/rpc.cpp b/src/rpc.cpp index d62a0d9ac..fdb57b3b8 100644 --- a/src/rpc.cpp +++ b/src/rpc.cpp @@ -1188,7 +1188,8 @@ Value listtransactions(const Array& params, bool fHelp) // 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)