From 479c99022e0e65ac525b45d3a18599726c00cc03 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Wed, 4 Apr 2012 09:07:55 +0200 Subject: [PATCH 1/5] remove HTML code around "Wallet" (displayed on overview page) and use Qt tags for font settings --- src/qt/forms/overviewpage.ui | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/qt/forms/overviewpage.ui b/src/qt/forms/overviewpage.ui index cc67fae5339..3cf7dd0ed34 100644 --- a/src/qt/forms/overviewpage.ui +++ b/src/qt/forms/overviewpage.ui @@ -78,12 +78,14 @@ + + + 11 + true + + - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Wallet</span></p></body></html> + Wallet From 607739befb6d4a647f03ed049b12222b1530f43c Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Sun, 6 May 2012 05:27:08 +0000 Subject: [PATCH 2/5] Bugfix: %-12I64d is not valid and causes the parameter to be skipped, use %12"PRI64d" instead Conflicts: src/walletdb.cpp --- src/db.cpp | 2 +- src/main.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/db.cpp b/src/db.cpp index bf335e7e3fd..4c0c557a5a8 100644 --- a/src/db.cpp +++ b/src/db.cpp @@ -867,7 +867,7 @@ int CWalletDB::LoadWallet(CWallet* pwallet) //// debug print //printf("LoadWallet %s\n", wtx.GetHash().ToString().c_str()); - //printf(" %12I64d %s %s %s\n", + //printf(" %12"PRI64d" %s %s %s\n", // wtx.vout[0].nValue, // DateTimeStrFormat("%x %H:%M:%S", wtx.GetBlockTime()).c_str(), // wtx.hashBlock.ToString().substr(0,20).c_str(), diff --git a/src/main.cpp b/src/main.cpp index e8cbc01c7f0..67d6638e0e5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2971,7 +2971,7 @@ CBlock* CreateNewBlock(CReserveKey& reservekey) dPriority += (double)nValueIn * nConf; if (fDebug && GetBoolArg("-printpriority")) - printf("priority nValueIn=%-12I64d nConf=%-5d dPriority=%-20.1f\n", nValueIn, nConf, dPriority); + printf("priority nValueIn=%-12"PRI64d" nConf=%-5d dPriority=%-20.1f\n", nValueIn, nConf, dPriority); } // Priority is sum(valuein * age) / txsize From b94e6eb5a510315c4713ffc8bcfbfceb674691dc Mon Sep 17 00:00:00 2001 From: Peter Todd Date: Sat, 28 Apr 2012 16:29:27 -0400 Subject: [PATCH 3/5] Fixed non-sensical error message Previously trying to create a multisig address that required less than one signature would output something like the following: "wrong number of keys(got 1, need at least 0)" --- src/bitcoinrpc.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp index 6525c151944..4426ac502ee 100644 --- a/src/bitcoinrpc.cpp +++ b/src/bitcoinrpc.cpp @@ -1002,10 +1002,12 @@ Value addmultisigaddress(const Array& params, bool fHelp) strAccount = AccountFromValue(params[2]); // Gather public keys - if (nRequired < 1 || keys.size() < nRequired) + if (nRequired < 1) + throw runtime_error("a multisignature address must require at least one key to redeem"); + if (keys.size() < nRequired) throw runtime_error( - strprintf("wrong number of keys" - "(got %d, need at least %d)", keys.size(), nRequired)); + strprintf("not enough keys supplied " + "(got %d keys, but need at least %d to redeem)", keys.size(), nRequired)); std::vector pubkeys; pubkeys.resize(keys.size()); for (unsigned int i = 0; i < keys.size(); i++) From adecb2ea00c8e8944a8c9bc5bc10e84ed1a568c0 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sat, 5 May 2012 21:22:55 +0200 Subject: [PATCH 4/5] Fix addrman crashes A function returned the element to remove from a bucket, instead of its position in that bucket. This function was only called when a tried bucket overflowed, which only happens after many outgoing connections have been made. Closes: #1065, #1156 --- src/addrman.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/addrman.cpp b/src/addrman.cpp index 11dd2a7b7df..9edbcc3a5f4 100644 --- a/src/addrman.cpp +++ b/src/addrman.cpp @@ -124,17 +124,20 @@ int CAddrMan::SelectTried(int nKBucket) // random shuffle the first few elements (using the entire list) // find the least recently tried among them int64 nOldest = -1; + int nOldestPos = -1; for (unsigned int i = 0; i < ADDRMAN_TRIED_ENTRIES_INSPECT_ON_EVICT && i < vTried.size(); i++) { int nPos = GetRandInt(vTried.size() - i) + i; int nTemp = vTried[nPos]; vTried[nPos] = vTried[i]; vTried[i] = nTemp; - if (nOldest == -1 || mapInfo[nTemp].nLastSuccess < mapInfo[nOldest].nLastSuccess) + if (nOldest == -1 || mapInfo[nTemp].nLastSuccess < mapInfo[nOldest].nLastSuccess) { nOldest = nTemp; + nOldestPos = nPos; + } } - return nOldest; + return nOldestPos; } int CAddrMan::ShrinkNew(int nUBucket) From 700e5a4d86d5180e6bb905c25a9e05695617f445 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sat, 5 May 2012 21:27:52 +0200 Subject: [PATCH 5/5] Bugfix: store source address in addrman --- src/addrman.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/addrman.h b/src/addrman.h index 91e1f87f052..5f1d7b2af9c 100644 --- a/src/addrman.h +++ b/src/addrman.h @@ -62,7 +62,7 @@ public: nRandomPos = -1; } - CAddrInfo(const CAddress &addrIn, const CNetAddr &addrSource) : CAddress(addrIn) + CAddrInfo(const CAddress &addrIn, const CNetAddr &addrSource) : CAddress(addrIn), source(addrSource) { Init(); }