diff options
Diffstat (limited to 'src')
48 files changed, 1450 insertions, 747 deletions
diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index e13d688158..de71fde9bc 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -78,7 +78,7 @@ bool AppInit(int argc, char* argv[]) if (mapArgs.count("-?") || mapArgs.count("--help")) { // First part of help message is specific to bitcoind / RPC client - std::string strUsage = _("Bitcoin version") + " " + FormatFullVersion() + "\n\n" + + std::string strUsage = _("Bitcoin Core Daemon") + " " + _("version") + " " + FormatFullVersion() + "\n\n" + _("Usage:") + "\n" + " bitcoind [options] " + _("Start Bitcoin server") + "\n" + _("Usage (deprecated, use bitcoin-cli):") + "\n" + diff --git a/src/init.cpp b/src/init.cpp index 40dd2d04cd..22ee0cfc08 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -194,10 +194,8 @@ std::string HelpMessage(HelpMessageMode hmm) strUsage += " -conf=<file> " + _("Specify configuration file (default: bitcoin.conf)") + "\n"; strUsage += " -datadir=<dir> " + _("Specify data directory") + "\n"; strUsage += " -testnet " + _("Use the test network") + "\n"; - strUsage += " -pid=<file> " + _("Specify pid file (default: bitcoind.pid)") + "\n"; strUsage += " -gen " + _("Generate coins (default: 0)") + "\n"; - strUsage += " -wallet=<file> " + _("Specify wallet file (within data directory)") + "\n"; strUsage += " -dbcache=<n> " + _("Set database cache size in megabytes (default: 25)") + "\n"; strUsage += " -timeout=<n> " + _("Specify connection timeout in milliseconds (default: 5000)") + "\n"; strUsage += " -proxy=<ip:port> " + _("Connect through SOCKS proxy") + "\n"; @@ -227,7 +225,6 @@ std::string HelpMessage(HelpMessageMode hmm) strUsage += " -upnp " + _("Use UPnP to map the listening port (default: 0)") + "\n"; #endif #endif - strUsage += " -paytxfee=<amt> " + _("Fee per kB to add to transactions you send") + "\n"; strUsage += " -debug=<category> " + _("Output debugging information (default: 0, supplying <category> is optional)") + "\n"; strUsage += _("If <category> is not supplied, output all debugging information.") + "\n"; strUsage += _("<category> can be:"); @@ -264,23 +261,27 @@ std::string HelpMessage(HelpMessageMode hmm) strUsage += " -rpcuser=<user> " + _("Username for JSON-RPC connections") + "\n"; strUsage += " -rpcpassword=<pw> " + _("Password for JSON-RPC connections") + "\n"; strUsage += " -rpcport=<port> " + _("Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332)") + "\n"; - strUsage += " -rpcallowip=<ip> " + _("Allow JSON-RPC connections from specified IP address") + "\n"; strUsage += " -rpcthreads=<n> " + _("Set the number of threads to service RPC calls (default: 4)") + "\n"; strUsage += " -blocknotify=<cmd> " + _("Execute command when the best block changes (%s in cmd is replaced by block hash)") + "\n"; - strUsage += " -walletnotify=<cmd> " + _("Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)") + "\n"; strUsage += " -alertnotify=<cmd> " + _("Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)") + "\n"; - strUsage += " -upgradewallet " + _("Upgrade wallet to latest format") + "\n"; strUsage += " -keypool=<n> " + _("Set key pool size to <n> (default: 100)") + "\n"; - strUsage += " -rescan " + _("Rescan the block chain for missing wallet transactions") + "\n"; - strUsage += " -salvagewallet " + _("Attempt to recover private keys from a corrupt wallet.dat") + "\n"; strUsage += " -checkblocks=<n> " + _("How many blocks to check at startup (default: 288, 0 = all)") + "\n"; strUsage += " -checklevel=<n> " + _("How thorough the block verification is (0-4, default: 3)") + "\n"; strUsage += " -txindex " + _("Maintain a full transaction index (default: 0)") + "\n"; strUsage += " -loadblock=<file> " + _("Imports blocks from external blk000??.dat file") + "\n"; strUsage += " -reindex " + _("Rebuild block chain index from current blk000??.dat files") + "\n"; strUsage += " -par=<n> " + _("Set the number of script verification threads (up to 16, 0 = auto, <0 = leave that many cores free, default: 0)") + "\n"; - +#ifdef ENABLE_WALLET + strUsage += "\n" + _("Wallet options:") + "\n"; + strUsage += " -disablewallet " + _("Do not load the wallet and disable wallet RPC calls") + "\n"; + strUsage += " -paytxfee=<amt> " + _("Fee per kB to add to transactions you send") + "\n"; + strUsage += " -rescan " + _("Rescan the block chain for missing wallet transactions") + "\n"; + strUsage += " -salvagewallet " + _("Attempt to recover private keys from a corrupt wallet.dat") + "\n"; + strUsage += " -upgradewallet " + _("Upgrade wallet to latest format") + "\n"; + strUsage += " -wallet=<file> " + _("Specify wallet file (within data directory)") + "\n"; + strUsage += " -walletnotify=<cmd> " + _("Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)") + "\n"; +#endif strUsage += "\n" + _("Block creation options:") + "\n"; strUsage += " -blockminsize=<n> " + _("Set minimum block size in bytes (default: 0)") + "\n"; strUsage += " -blockmaxsize=<n> " + strprintf(_("Set maximum block size in bytes (default: %d)"), DEFAULT_BLOCK_MAX_SIZE) + "\n"; @@ -858,8 +859,8 @@ bool AppInit2(boost::thread_group& threadGroup, bool fForceServer) } } - // as LoadBlockIndex can take several minutes, it's possible the user - // requested to kill bitcoin-qt during the last operation. If so, exit. + // As LoadBlockIndex can take several minutes, it's possible the user + // requested to kill the GUI during the last operation. If so, exit. // As the program has not fully started yet, Shutdown() is possibly overkill. if (fRequestShutdown) { diff --git a/src/leveldb/AUTHORS b/src/leveldb/AUTHORS index fc40194ab9..2439d7a452 100644 --- a/src/leveldb/AUTHORS +++ b/src/leveldb/AUTHORS @@ -9,3 +9,4 @@ Sanjay Ghemawat <sanjay@google.com> # Partial list of contributors: Kevin Regan <kevin.d.regan@gmail.com> +Johan Bilien <jobi@litl.com> diff --git a/src/leveldb/Makefile b/src/leveldb/Makefile index 20c9c4f287..344ff2972a 100644 --- a/src/leveldb/Makefile +++ b/src/leveldb/Makefile @@ -44,6 +44,7 @@ TESTS = \ filename_test \ filter_block_test \ issue178_test \ + issue200_test \ log_test \ memenv_test \ skiplist_test \ @@ -71,7 +72,7 @@ SHARED = $(SHARED1) else # Update db.h if you change these. SHARED_MAJOR = 1 -SHARED_MINOR = 13 +SHARED_MINOR = 15 SHARED1 = libleveldb.$(PLATFORM_SHARED_EXT) SHARED2 = $(SHARED1).$(SHARED_MAJOR) SHARED3 = $(SHARED1).$(SHARED_MAJOR).$(SHARED_MINOR) @@ -154,6 +155,9 @@ filter_block_test: table/filter_block_test.o $(LIBOBJECTS) $(TESTHARNESS) issue178_test: issues/issue178_test.o $(LIBOBJECTS) $(TESTHARNESS) $(CXX) $(LDFLAGS) issues/issue178_test.o $(LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS) +issue200_test: issues/issue200_test.o $(LIBOBJECTS) $(TESTHARNESS) + $(CXX) $(LDFLAGS) issues/issue200_test.o $(LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS) + log_test: db/log_test.o $(LIBOBJECTS) $(TESTHARNESS) $(CXX) $(LDFLAGS) db/log_test.o $(LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS) @@ -191,14 +195,14 @@ IOSVERSION=$(shell defaults read $(PLATFORMSROOT)/iPhoneOS.platform/version CFBu mkdir -p ios-x86/$(dir $@) $(CXX) $(CXXFLAGS) -isysroot $(SIMULATORROOT)/SDKs/iPhoneSimulator$(IOSVERSION).sdk -arch i686 -c $< -o ios-x86/$@ mkdir -p ios-arm/$(dir $@) - $(DEVICEROOT)/usr/bin/$(CXX) $(CXXFLAGS) -isysroot $(DEVICEROOT)/SDKs/iPhoneOS$(IOSVERSION).sdk -arch armv6 -arch armv7 -c $< -o ios-arm/$@ + xcrun -sdk iphoneos $(CXX) $(CXXFLAGS) -isysroot $(DEVICEROOT)/SDKs/iPhoneOS$(IOSVERSION).sdk -arch armv6 -arch armv7 -c $< -o ios-arm/$@ lipo ios-x86/$@ ios-arm/$@ -create -output $@ .c.o: mkdir -p ios-x86/$(dir $@) $(CC) $(CFLAGS) -isysroot $(SIMULATORROOT)/SDKs/iPhoneSimulator$(IOSVERSION).sdk -arch i686 -c $< -o ios-x86/$@ mkdir -p ios-arm/$(dir $@) - $(DEVICEROOT)/usr/bin/$(CC) $(CFLAGS) -isysroot $(DEVICEROOT)/SDKs/iPhoneOS$(IOSVERSION).sdk -arch armv6 -arch armv7 -c $< -o ios-arm/$@ + xcrun -sdk iphoneos $(CC) $(CFLAGS) -isysroot $(DEVICEROOT)/SDKs/iPhoneOS$(IOSVERSION).sdk -arch armv6 -arch armv7 -c $< -o ios-arm/$@ lipo ios-x86/$@ ios-arm/$@ -create -output $@ else diff --git a/src/leveldb/build_detect_platform b/src/leveldb/build_detect_platform index bdfd64172c..85b1ce0224 100755 --- a/src/leveldb/build_detect_platform +++ b/src/leveldb/build_detect_platform @@ -137,6 +137,16 @@ case "$TARGET_OS" in # man ld: +h internal_name PLATFORM_SHARED_LDFLAGS="-shared -Wl,+h -Wl," ;; + IOS) + PLATFORM=IOS + COMMON_FLAGS="$MEMCMP_FLAG -DOS_MACOSX" + [ -z "$INSTALL_PATH" ] && INSTALL_PATH=`pwd` + PORT_FILE=port/port_posix.cc + PLATFORM_SHARED_EXT= + PLATFORM_SHARED_LDFLAGS= + PLATFORM_SHARED_CFLAGS= + PLATFORM_SHARED_VERSIONED= + ;; OS_WINDOWS_CROSSCOMPILE | NATIVE_WINDOWS) PLATFORM=OS_WINDOWS COMMON_FLAGS="-fno-builtin-memcmp -D_REENTRANT -DOS_WINDOWS -DLEVELDB_PLATFORM_WINDOWS -DWINVER=0x0500 -D__USE_MINGW_ANSI_STDIO=1" diff --git a/src/leveldb/db/corruption_test.cc b/src/leveldb/db/corruption_test.cc index b37ffdfe64..96afc68913 100644 --- a/src/leveldb/db/corruption_test.cc +++ b/src/leveldb/db/corruption_test.cc @@ -75,7 +75,13 @@ class CorruptionTest { Slice key = Key(i, &key_space); batch.Clear(); batch.Put(key, Value(i, &value_space)); - ASSERT_OK(db_->Write(WriteOptions(), &batch)); + WriteOptions options; + // Corrupt() doesn't work without this sync on windows; stat reports 0 for + // the file size. + if (i == n - 1) { + options.sync = true; + } + ASSERT_OK(db_->Write(options, &batch)); } } @@ -125,7 +131,7 @@ class CorruptionTest { FileType type; std::string fname; int picked_number = -1; - for (int i = 0; i < filenames.size(); i++) { + for (size_t i = 0; i < filenames.size(); i++) { if (ParseFileName(filenames[i], &number, &type) && type == filetype && int(number) > picked_number) { // Pick latest file @@ -238,6 +244,22 @@ TEST(CorruptionTest, TableFile) { Check(90, 99); } +TEST(CorruptionTest, TableFileRepair) { + options_.block_size = 2 * kValueSize; // Limit scope of corruption + options_.paranoid_checks = true; + Reopen(); + Build(100); + DBImpl* dbi = reinterpret_cast<DBImpl*>(db_); + dbi->TEST_CompactMemTable(); + dbi->TEST_CompactRange(0, NULL, NULL); + dbi->TEST_CompactRange(1, NULL, NULL); + + Corrupt(kTableFile, 100, 1); + RepairDB(); + Reopen(); + Check(95, 99); +} + TEST(CorruptionTest, TableFileIndexData) { Build(10000); // Enough to build multiple Tables DBImpl* dbi = reinterpret_cast<DBImpl*>(db_); diff --git a/src/leveldb/db/db_bench.cc b/src/leveldb/db/db_bench.cc index 7abdf87587..fc46d89693 100644 --- a/src/leveldb/db/db_bench.cc +++ b/src/leveldb/db/db_bench.cc @@ -128,7 +128,7 @@ class RandomGenerator { pos_ = 0; } - Slice Generate(int len) { + Slice Generate(size_t len) { if (pos_ + len > data_.size()) { pos_ = 0; assert(len < data_.size()); @@ -139,11 +139,11 @@ class RandomGenerator { }; static Slice TrimSpace(Slice s) { - int start = 0; + size_t start = 0; while (start < s.size() && isspace(s[start])) { start++; } - int limit = s.size(); + size_t limit = s.size(); while (limit > start && isspace(s[limit-1])) { limit--; } @@ -399,7 +399,7 @@ class Benchmark { heap_counter_(0) { std::vector<std::string> files; Env::Default()->GetChildren(FLAGS_db, &files); - for (int i = 0; i < files.size(); i++) { + for (size_t i = 0; i < files.size(); i++) { if (Slice(files[i]).starts_with("heap-")) { Env::Default()->DeleteFile(std::string(FLAGS_db) + "/" + files[i]); } diff --git a/src/leveldb/db/db_impl.cc b/src/leveldb/db/db_impl.cc index fa1351038b..faf5e7d7ba 100644 --- a/src/leveldb/db/db_impl.cc +++ b/src/leveldb/db/db_impl.cc @@ -133,8 +133,7 @@ DBImpl::DBImpl(const Options& raw_options, const std::string& dbname) seed_(0), tmp_batch_(new WriteBatch), bg_compaction_scheduled_(false), - manual_compaction_(NULL), - consecutive_compaction_errors_(0) { + manual_compaction_(NULL) { mem_->Ref(); has_imm_.Release_Store(NULL); @@ -217,6 +216,12 @@ void DBImpl::MaybeIgnoreError(Status* s) const { } void DBImpl::DeleteObsoleteFiles() { + if (!bg_error_.ok()) { + // After a background error, we don't know whether a new version may + // or may not have been committed, so we cannot safely garbage collect. + return; + } + // Make a set of all of the live files std::set<uint64_t> live = pending_outputs_; versions_->AddLiveFiles(&live); @@ -495,7 +500,7 @@ Status DBImpl::WriteLevel0Table(MemTable* mem, VersionEdit* edit, return s; } -Status DBImpl::CompactMemTable() { +void DBImpl::CompactMemTable() { mutex_.AssertHeld(); assert(imm_ != NULL); @@ -523,9 +528,9 @@ Status DBImpl::CompactMemTable() { imm_ = NULL; has_imm_.Release_Store(NULL); DeleteObsoleteFiles(); + } else { + RecordBackgroundError(s); } - - return s; } void DBImpl::CompactRange(const Slice* begin, const Slice* end) { @@ -568,16 +573,18 @@ void DBImpl::TEST_CompactRange(int level, const Slice* begin,const Slice* end) { } MutexLock l(&mutex_); - while (!manual.done) { - while (manual_compaction_ != NULL) { - bg_cv_.Wait(); - } - manual_compaction_ = &manual; - MaybeScheduleCompaction(); - while (manual_compaction_ == &manual) { + while (!manual.done && !shutting_down_.Acquire_Load() && bg_error_.ok()) { + if (manual_compaction_ == NULL) { // Idle + manual_compaction_ = &manual; + MaybeScheduleCompaction(); + } else { // Running either my compaction or another compaction. bg_cv_.Wait(); } } + if (manual_compaction_ == &manual) { + // Cancel my manual compaction since we aborted early for some reason. + manual_compaction_ = NULL; + } } Status DBImpl::TEST_CompactMemTable() { @@ -596,12 +603,22 @@ Status DBImpl::TEST_CompactMemTable() { return s; } +void DBImpl::RecordBackgroundError(const Status& s) { + mutex_.AssertHeld(); + if (bg_error_.ok()) { + bg_error_ = s; + bg_cv_.SignalAll(); + } +} + void DBImpl::MaybeScheduleCompaction() { mutex_.AssertHeld(); if (bg_compaction_scheduled_) { // Already scheduled } else if (shutting_down_.Acquire_Load()) { // DB is being deleted; no more background compactions + } else if (!bg_error_.ok()) { + // Already got an error; no more changes } else if (imm_ == NULL && manual_compaction_ == NULL && !versions_->NeedsCompaction()) { @@ -619,30 +636,12 @@ void DBImpl::BGWork(void* db) { void DBImpl::BackgroundCall() { MutexLock l(&mutex_); assert(bg_compaction_scheduled_); - if (!shutting_down_.Acquire_Load()) { - Status s = BackgroundCompaction(); - if (s.ok()) { - // Success - consecutive_compaction_errors_ = 0; - } else if (shutting_down_.Acquire_Load()) { - // Error most likely due to shutdown; do not wait - } else { - // Wait a little bit before retrying background compaction in - // case this is an environmental problem and we do not want to - // chew up resources for failed compactions for the duration of - // the problem. - bg_cv_.SignalAll(); // In case a waiter can proceed despite the error - Log(options_.info_log, "Waiting after background compaction error: %s", - s.ToString().c_str()); - mutex_.Unlock(); - ++consecutive_compaction_errors_; - int seconds_to_sleep = 1; - for (int i = 0; i < 3 && i < consecutive_compaction_errors_ - 1; ++i) { - seconds_to_sleep *= 2; - } - env_->SleepForMicroseconds(seconds_to_sleep * 1000000); - mutex_.Lock(); - } + if (shutting_down_.Acquire_Load()) { + // No more background work when shutting down. + } else if (!bg_error_.ok()) { + // No more background work after a background error. + } else { + BackgroundCompaction(); } bg_compaction_scheduled_ = false; @@ -653,11 +652,12 @@ void DBImpl::BackgroundCall() { bg_cv_.SignalAll(); } -Status DBImpl::BackgroundCompaction() { +void DBImpl::BackgroundCompaction() { mutex_.AssertHeld(); if (imm_ != NULL) { - return CompactMemTable(); + CompactMemTable(); + return; } Compaction* c; @@ -691,6 +691,9 @@ Status DBImpl::BackgroundCompaction() { c->edit()->AddFile(c->level() + 1, f->number, f->file_size, f->smallest, f->largest); status = versions_->LogAndApply(c->edit(), &mutex_); + if (!status.ok()) { + RecordBackgroundError(status); + } VersionSet::LevelSummaryStorage tmp; Log(options_.info_log, "Moved #%lld to level-%d %lld bytes %s: %s\n", static_cast<unsigned long long>(f->number), @@ -701,6 +704,9 @@ Status DBImpl::BackgroundCompaction() { } else { CompactionState* compact = new CompactionState(c); status = DoCompactionWork(compact); + if (!status.ok()) { + RecordBackgroundError(status); + } CleanupCompaction(compact); c->ReleaseInputs(); DeleteObsoleteFiles(); @@ -714,9 +720,6 @@ Status DBImpl::BackgroundCompaction() { } else { Log(options_.info_log, "Compaction error: %s", status.ToString().c_str()); - if (options_.paranoid_checks && bg_error_.ok()) { - bg_error_ = status; - } } if (is_manual) { @@ -732,7 +735,6 @@ Status DBImpl::BackgroundCompaction() { } manual_compaction_ = NULL; } - return status; } void DBImpl::CleanupCompaction(CompactionState* compact) { @@ -1002,6 +1004,9 @@ Status DBImpl::DoCompactionWork(CompactionState* compact) { if (status.ok()) { status = InstallCompactionResults(compact); } + if (!status.ok()) { + RecordBackgroundError(status); + } VersionSet::LevelSummaryStorage tmp; Log(options_.info_log, "compacted to: %s", versions_->LevelSummary(&tmp)); @@ -1185,13 +1190,23 @@ Status DBImpl::Write(const WriteOptions& options, WriteBatch* my_batch) { { mutex_.Unlock(); status = log_->AddRecord(WriteBatchInternal::Contents(updates)); + bool sync_error = false; if (status.ok() && options.sync) { status = logfile_->Sync(); + if (!status.ok()) { + sync_error = true; + } } if (status.ok()) { status = WriteBatchInternal::InsertInto(updates, mem_); } mutex_.Lock(); + if (sync_error) { + // The state of the log file is indeterminate: the log record we + // just added may or may not show up when the DB is re-opened. + // So we force the DB into a mode where all future writes fail. + RecordBackgroundError(status); + } } if (updates == tmp_batch_) tmp_batch_->Clear(); diff --git a/src/leveldb/db/db_impl.h b/src/leveldb/db/db_impl.h index 75fd30abe9..cfc998164a 100644 --- a/src/leveldb/db/db_impl.h +++ b/src/leveldb/db/db_impl.h @@ -87,8 +87,8 @@ class DBImpl : public DB { // Compact the in-memory write buffer to disk. Switches to a new // log-file/memtable and writes a new descriptor iff successful. - Status CompactMemTable() - EXCLUSIVE_LOCKS_REQUIRED(mutex_); + // Errors are recorded in bg_error_. + void CompactMemTable() EXCLUSIVE_LOCKS_REQUIRED(mutex_); Status RecoverLogFile(uint64_t log_number, VersionEdit* edit, @@ -102,10 +102,12 @@ class DBImpl : public DB { EXCLUSIVE_LOCKS_REQUIRED(mutex_); WriteBatch* BuildBatchGroup(Writer** last_writer); + void RecordBackgroundError(const Status& s); + void MaybeScheduleCompaction() EXCLUSIVE_LOCKS_REQUIRED(mutex_); static void BGWork(void* db); void BackgroundCall(); - Status BackgroundCompaction() EXCLUSIVE_LOCKS_REQUIRED(mutex_); + void BackgroundCompaction() EXCLUSIVE_LOCKS_REQUIRED(mutex_); void CleanupCompaction(CompactionState* compact) EXCLUSIVE_LOCKS_REQUIRED(mutex_); Status DoCompactionWork(CompactionState* compact) @@ -170,7 +172,6 @@ class DBImpl : public DB { // Have we encountered a background error in paranoid mode? Status bg_error_; - int consecutive_compaction_errors_; // Per level compaction stats. stats_[level] stores the stats for // compactions that produced data for the specified "level". diff --git a/src/leveldb/db/db_iter.cc b/src/leveldb/db/db_iter.cc index 071a54e3f4..3b2035e9e3 100644 --- a/src/leveldb/db/db_iter.cc +++ b/src/leveldb/db/db_iter.cc @@ -161,12 +161,13 @@ void DBIter::Next() { saved_key_.clear(); return; } + // saved_key_ already contains the key to skip past. + } else { + // Store in saved_key_ the current key so we skip it below. + SaveKey(ExtractUserKey(iter_->key()), &saved_key_); } - // Temporarily use saved_key_ as storage for key to skip. - std::string* skip = &saved_key_; - SaveKey(ExtractUserKey(iter_->key()), skip); - FindNextUserEntry(true, skip); + FindNextUserEntry(true, &saved_key_); } void DBIter::FindNextUserEntry(bool skipping, std::string* skip) { diff --git a/src/leveldb/db/db_test.cc b/src/leveldb/db/db_test.cc index 49aae04dbd..280b01c14b 100644 --- a/src/leveldb/db/db_test.cc +++ b/src/leveldb/db/db_test.cc @@ -57,8 +57,11 @@ void DelayMilliseconds(int millis) { // Special Env used to delay background operations class SpecialEnv : public EnvWrapper { public: - // sstable Sync() calls are blocked while this pointer is non-NULL. - port::AtomicPointer delay_sstable_sync_; + // sstable/log Sync() calls are blocked while this pointer is non-NULL. + port::AtomicPointer delay_data_sync_; + + // sstable/log Sync() calls return an error. + port::AtomicPointer data_sync_error_; // Simulate no-space errors while this pointer is non-NULL. port::AtomicPointer no_space_; @@ -75,11 +78,9 @@ class SpecialEnv : public EnvWrapper { bool count_random_reads_; AtomicCounter random_read_counter_; - AtomicCounter sleep_counter_; - AtomicCounter sleep_time_counter_; - explicit SpecialEnv(Env* base) : EnvWrapper(base) { - delay_sstable_sync_.Release_Store(NULL); + delay_data_sync_.Release_Store(NULL); + data_sync_error_.Release_Store(NULL); no_space_.Release_Store(NULL); non_writable_.Release_Store(NULL); count_random_reads_ = false; @@ -88,17 +89,17 @@ class SpecialEnv : public EnvWrapper { } Status NewWritableFile(const std::string& f, WritableFile** r) { - class SSTableFile : public WritableFile { + class DataFile : public WritableFile { private: SpecialEnv* env_; WritableFile* base_; public: - SSTableFile(SpecialEnv* env, WritableFile* base) + DataFile(SpecialEnv* env, WritableFile* base) : env_(env), base_(base) { } - ~SSTableFile() { delete base_; } + ~DataFile() { delete base_; } Status Append(const Slice& data) { if (env_->no_space_.Acquire_Load() != NULL) { // Drop writes on the floor @@ -110,7 +111,10 @@ class SpecialEnv : public EnvWrapper { Status Close() { return base_->Close(); } Status Flush() { return base_->Flush(); } Status Sync() { - while (env_->delay_sstable_sync_.Acquire_Load() != NULL) { + if (env_->data_sync_error_.Acquire_Load() != NULL) { + return Status::IOError("simulated data sync error"); + } + while (env_->delay_data_sync_.Acquire_Load() != NULL) { DelayMilliseconds(100); } return base_->Sync(); @@ -147,8 +151,9 @@ class SpecialEnv : public EnvWrapper { Status s = target()->NewWritableFile(f, r); if (s.ok()) { - if (strstr(f.c_str(), ".sst") != NULL) { - *r = new SSTableFile(this, *r); + if (strstr(f.c_str(), ".ldb") != NULL || + strstr(f.c_str(), ".log") != NULL) { + *r = new DataFile(this, *r); } else if (strstr(f.c_str(), "MANIFEST") != NULL) { *r = new ManifestFile(this, *r); } @@ -179,12 +184,6 @@ class SpecialEnv : public EnvWrapper { } return s; } - - virtual void SleepForMicroseconds(int micros) { - sleep_counter_.Increment(); - sleep_time_counter_.IncrementBy(micros); - } - }; class DBTest { @@ -322,7 +321,7 @@ class DBTest { } // Check reverse iteration results are the reverse of forward results - int matched = 0; + size_t matched = 0; for (iter->SeekToLast(); iter->Valid(); iter->Prev()) { ASSERT_LT(matched, forward.size()); ASSERT_EQ(IterStatus(iter), forward[forward.size() - matched - 1]); @@ -484,6 +483,24 @@ class DBTest { } return false; } + + // Returns number of files renamed. + int RenameLDBToSST() { + std::vector<std::string> filenames; + ASSERT_OK(env_->GetChildren(dbname_, &filenames)); + uint64_t number; + FileType type; + int files_renamed = 0; + for (size_t i = 0; i < filenames.size(); i++) { + if (ParseFileName(filenames[i], &number, &type) && type == kTableFile) { + const std::string from = TableFileName(dbname_, number); + const std::string to = SSTTableFileName(dbname_, number); + ASSERT_OK(env_->RenameFile(from, to)); + files_renamed++; + } + } + return files_renamed; + } }; TEST(DBTest, Empty) { @@ -525,11 +542,11 @@ TEST(DBTest, GetFromImmutableLayer) { ASSERT_OK(Put("foo", "v1")); ASSERT_EQ("v1", Get("foo")); - env_->delay_sstable_sync_.Release_Store(env_); // Block sync calls + env_->delay_data_sync_.Release_Store(env_); // Block sync calls Put("k1", std::string(100000, 'x')); // Fill memtable Put("k2", std::string(100000, 'y')); // Trigger compaction ASSERT_EQ("v1", Get("foo")); - env_->delay_sstable_sync_.Release_Store(NULL); // Release sync calls + env_->delay_data_sync_.Release_Store(NULL); // Release sync calls } while (ChangeOptions()); } @@ -1516,41 +1533,13 @@ TEST(DBTest, NoSpace) { Compact("a", "z"); const int num_files = CountFiles(); env_->no_space_.Release_Store(env_); // Force out-of-space errors - env_->sleep_counter_.Reset(); - for (int i = 0; i < 5; i++) { + for (int i = 0; i < 10; i++) { for (int level = 0; level < config::kNumLevels-1; level++) { dbfull()->TEST_CompactRange(level, NULL, NULL); } } env_->no_space_.Release_Store(NULL); ASSERT_LT(CountFiles(), num_files + 3); - - // Check that compaction attempts slept after errors - ASSERT_GE(env_->sleep_counter_.Read(), 5); -} - -TEST(DBTest, ExponentialBackoff) { - Options options = CurrentOptions(); - options.env = env_; - Reopen(&options); - - ASSERT_OK(Put("foo", "v1")); - ASSERT_EQ("v1", Get("foo")); - Compact("a", "z"); - env_->non_writable_.Release_Store(env_); // Force errors for new files - env_->sleep_counter_.Reset(); - env_->sleep_time_counter_.Reset(); - for (int i = 0; i < 5; i++) { - dbfull()->TEST_CompactRange(2, NULL, NULL); - } - env_->non_writable_.Release_Store(NULL); - - // Wait for compaction to finish - DelayMilliseconds(1000); - - ASSERT_GE(env_->sleep_counter_.Read(), 5); - ASSERT_LT(env_->sleep_counter_.Read(), 10); - ASSERT_GE(env_->sleep_time_counter_.Read(), 10e6); } TEST(DBTest, NonWritableFileSystem) { @@ -1573,6 +1562,37 @@ TEST(DBTest, NonWritableFileSystem) { env_->non_writable_.Release_Store(NULL); } +TEST(DBTest, WriteSyncError) { + // Check that log sync errors cause the DB to disallow future writes. + + // (a) Cause log sync calls to fail + Options options = CurrentOptions(); + options.env = env_; + Reopen(&options); + env_->data_sync_error_.Release_Store(env_); + + // (b) Normal write should succeed + WriteOptions w; + ASSERT_OK(db_->Put(w, "k1", "v1")); + ASSERT_EQ("v1", Get("k1")); + + // (c) Do a sync write; should fail + w.sync = true; + ASSERT_TRUE(!db_->Put(w, "k2", "v2").ok()); + ASSERT_EQ("v1", Get("k1")); + ASSERT_EQ("NOT_FOUND", Get("k2")); + + // (d) make sync behave normally + env_->data_sync_error_.Release_Store(NULL); + + // (e) Do a non-sync write; should fail + w.sync = false; + ASSERT_TRUE(!db_->Put(w, "k3", "v3").ok()); + ASSERT_EQ("v1", Get("k1")); + ASSERT_EQ("NOT_FOUND", Get("k2")); + ASSERT_EQ("NOT_FOUND", Get("k3")); +} + TEST(DBTest, ManifestWriteError) { // Test for the following problem: // (a) Compaction produces file F @@ -1632,6 +1652,22 @@ TEST(DBTest, MissingSSTFile) { << s.ToString(); } +TEST(DBTest, StillReadSST) { + ASSERT_OK(Put("foo", "bar")); + ASSERT_EQ("bar", Get("foo")); + + // Dump the memtable to disk. + dbfull()->TEST_CompactMemTable(); + ASSERT_EQ("bar", Get("foo")); + Close(); + ASSERT_GT(RenameLDBToSST(), 0); + Options options = CurrentOptions(); + options.paranoid_checks = true; + Status s = TryReopen(&options); + ASSERT_TRUE(s.ok()); + ASSERT_EQ("bar", Get("foo")); +} + TEST(DBTest, FilesDeletedAfterCompaction) { ASSERT_OK(Put("foo", "v2")); Compact("a", "z"); @@ -1663,7 +1699,7 @@ TEST(DBTest, BloomFilter) { dbfull()->TEST_CompactMemTable(); // Prevent auto compactions triggered by seeks - env_->delay_sstable_sync_.Release_Store(env_); + env_->delay_data_sync_.Release_Store(env_); // Lookup present keys. Should rarely read from small sstable. env_->random_read_counter_.Reset(); @@ -1684,7 +1720,7 @@ TEST(DBTest, BloomFilter) { fprintf(stderr, "%d missing => %d reads\n", N, reads); ASSERT_LE(reads, 3*N/100); - env_->delay_sstable_sync_.Release_Store(NULL); + env_->delay_data_sync_.Release_Store(NULL); Close(); delete options.block_cache; delete options.filter_policy; @@ -1744,7 +1780,7 @@ static void MTThreadBody(void* arg) { ASSERT_EQ(k, key); ASSERT_GE(w, 0); ASSERT_LT(w, kNumThreads); - ASSERT_LE(c, reinterpret_cast<uintptr_t>( + ASSERT_LE(static_cast<uintptr_t>(c), reinterpret_cast<uintptr_t>( t->state->counter[w].Acquire_Load())); } } diff --git a/src/leveldb/db/filename.cc b/src/leveldb/db/filename.cc index 3c4d49f64e..da32946d99 100644 --- a/src/leveldb/db/filename.cc +++ b/src/leveldb/db/filename.cc @@ -31,6 +31,11 @@ std::string LogFileName(const std::string& name, uint64_t number) { std::string TableFileName(const std::string& name, uint64_t number) { assert(number > 0); + return MakeFileName(name, number, "ldb"); +} + +std::string SSTTableFileName(const std::string& name, uint64_t number) { + assert(number > 0); return MakeFileName(name, number, "sst"); } @@ -71,7 +76,7 @@ std::string OldInfoLogFileName(const std::string& dbname) { // dbname/LOG // dbname/LOG.old // dbname/MANIFEST-[0-9]+ -// dbname/[0-9]+.(log|sst) +// dbname/[0-9]+.(log|sst|ldb) bool ParseFileName(const std::string& fname, uint64_t* number, FileType* type) { @@ -106,7 +111,7 @@ bool ParseFileName(const std::string& fname, Slice suffix = rest; if (suffix == Slice(".log")) { *type = kLogFile; - } else if (suffix == Slice(".sst")) { + } else if (suffix == Slice(".sst") || suffix == Slice(".ldb")) { *type = kTableFile; } else if (suffix == Slice(".dbtmp")) { *type = kTempFile; diff --git a/src/leveldb/db/filename.h b/src/leveldb/db/filename.h index d5d09b1146..87a752605d 100644 --- a/src/leveldb/db/filename.h +++ b/src/leveldb/db/filename.h @@ -37,6 +37,11 @@ extern std::string LogFileName(const std::string& dbname, uint64_t number); // "dbname". extern std::string TableFileName(const std::string& dbname, uint64_t number); +// Return the legacy file name for an sstable with the specified number +// in the db named by "dbname". The result will be prefixed with +// "dbname". +extern std::string SSTTableFileName(const std::string& dbname, uint64_t number); + // Return the name of the descriptor file for the db named by // "dbname" and the specified incarnation number. The result will be // prefixed with "dbname". diff --git a/src/leveldb/db/filename_test.cc b/src/leveldb/db/filename_test.cc index 5a26da4728..a32556deaf 100644 --- a/src/leveldb/db/filename_test.cc +++ b/src/leveldb/db/filename_test.cc @@ -27,6 +27,7 @@ TEST(FileNameTest, Parse) { { "100.log", 100, kLogFile }, { "0.log", 0, kLogFile }, { "0.sst", 0, kTableFile }, + { "0.ldb", 0, kTableFile }, { "CURRENT", 0, kCurrentFile }, { "LOCK", 0, kDBLockFile }, { "MANIFEST-2", 2, kDescriptorFile }, diff --git a/src/leveldb/db/repair.cc b/src/leveldb/db/repair.cc index 022d52f3de..96c9b37af1 100644 --- a/src/leveldb/db/repair.cc +++ b/src/leveldb/db/repair.cc @@ -244,60 +244,133 @@ class Repairer { void ExtractMetaData() { std::vector<TableInfo> kept; for (size_t i = 0; i < table_numbers_.size(); i++) { - TableInfo t; - t.meta.number = table_numbers_[i]; - Status status = ScanTable(&t); - if (!status.ok()) { - std::string fname = TableFileName(dbname_, table_numbers_[i]); - Log(options_.info_log, "Table #%llu: ignoring %s", - (unsigned long long) table_numbers_[i], - status.ToString().c_str()); - ArchiveFile(fname); - } else { - tables_.push_back(t); - } + ScanTable(table_numbers_[i]); } } - Status ScanTable(TableInfo* t) { - std::string fname = TableFileName(dbname_, t->meta.number); + Iterator* NewTableIterator(const FileMetaData& meta) { + // Same as compaction iterators: if paranoid_checks are on, turn + // on checksum verification. + ReadOptions r; + r.verify_checksums = options_.paranoid_checks; + return table_cache_->NewIterator(r, meta.number, meta.file_size); + } + + void ScanTable(uint64_t number) { + TableInfo t; + t.meta.number = number; + std::string fname = TableFileName(dbname_, number); + Status status = env_->GetFileSize(fname, &t.meta.file_size); + if (!status.ok()) { + // Try alternate file name. + fname = SSTTableFileName(dbname_, number); + Status s2 = env_->GetFileSize(fname, &t.meta.file_size); + if (s2.ok()) { + status = Status::OK(); + } + } + if (!status.ok()) { + ArchiveFile(TableFileName(dbname_, number)); + ArchiveFile(SSTTableFileName(dbname_, number)); + Log(options_.info_log, "Table #%llu: dropped: %s", + (unsigned long long) t.meta.number, + status.ToString().c_str()); + return; + } + + // Extract metadata by scanning through table. int counter = 0; - Status status = env_->GetFileSize(fname, &t->meta.file_size); - if (status.ok()) { - Iterator* iter = table_cache_->NewIterator( - ReadOptions(), t->meta.number, t->meta.file_size); - bool empty = true; - ParsedInternalKey parsed; - t->max_sequence = 0; - for (iter->SeekToFirst(); iter->Valid(); iter->Next()) { - Slice key = iter->key(); - if (!ParseInternalKey(key, &parsed)) { - Log(options_.info_log, "Table #%llu: unparsable key %s", - (unsigned long long) t->meta.number, - EscapeString(key).c_str()); - continue; - } + Iterator* iter = NewTableIterator(t.meta); + bool empty = true; + ParsedInternalKey parsed; + t.max_sequence = 0; + for (iter->SeekToFirst(); iter->Valid(); iter->Next()) { + Slice key = iter->key(); + if (!ParseInternalKey(key, &parsed)) { + Log(options_.info_log, "Table #%llu: unparsable key %s", + (unsigned long long) t.meta.number, + EscapeString(key).c_str()); + continue; + } - counter++; - if (empty) { - empty = false; - t->meta.smallest.DecodeFrom(key); - } - t->meta.largest.DecodeFrom(key); - if (parsed.sequence > t->max_sequence) { - t->max_sequence = parsed.sequence; - } + counter++; + if (empty) { + empty = false; + t.meta.smallest.DecodeFrom(key); } - if (!iter->status().ok()) { - status = iter->status(); + t.meta.largest.DecodeFrom(key); + if (parsed.sequence > t.max_sequence) { + t.max_sequence = parsed.sequence; } - delete iter; } + if (!iter->status().ok()) { + status = iter->status(); + } + delete iter; Log(options_.info_log, "Table #%llu: %d entries %s", - (unsigned long long) t->meta.number, + (unsigned long long) t.meta.number, counter, status.ToString().c_str()); - return status; + + if (status.ok()) { + tables_.push_back(t); + } else { + RepairTable(fname, t); // RepairTable archives input file. + } + } + + void RepairTable(const std::string& src, TableInfo t) { + // We will copy src contents to a new table and then rename the + // new table over the source. + + // Create builder. + std::string copy = TableFileName(dbname_, next_file_number_++); + WritableFile* file; + Status s = env_->NewWritableFile(copy, &file); + if (!s.ok()) { + return; + } + TableBuilder* builder = new TableBuilder(options_, file); + + // Copy data. + Iterator* iter = NewTableIterator(t.meta); + int counter = 0; + for (iter->SeekToFirst(); iter->Valid(); iter->Next()) { + builder->Add(iter->key(), iter->value()); + counter++; + } + delete iter; + + ArchiveFile(src); + if (counter == 0) { + builder->Abandon(); // Nothing to save + } else { + s = builder->Finish(); + if (s.ok()) { + t.meta.file_size = builder->FileSize(); + } + } + delete builder; + builder = NULL; + + if (s.ok()) { + s = file->Close(); + } + delete file; + file = NULL; + + if (counter > 0 && s.ok()) { + std::string orig = TableFileName(dbname_, t.meta.number); + s = env_->RenameFile(copy, orig); + if (s.ok()) { + Log(options_.info_log, "Table #%llu: %d entries repaired", + (unsigned long long) t.meta.number, counter); + tables_.push_back(t); + } + } + if (!s.ok()) { + env_->DeleteFile(copy); + } } Status WriteDescriptor() { diff --git a/src/leveldb/db/table_cache.cc b/src/leveldb/db/table_cache.cc index 497db27076..e3d82cd3ea 100644 --- a/src/leveldb/db/table_cache.cc +++ b/src/leveldb/db/table_cache.cc @@ -54,6 +54,12 @@ Status TableCache::FindTable(uint64_t file_number, uint64_t file_size, RandomAccessFile* file = NULL; Table* table = NULL; s = env_->NewRandomAccessFile(fname, &file); + if (!s.ok()) { + std::string old_fname = SSTTableFileName(dbname_, file_number); + if (env_->NewRandomAccessFile(old_fname, &file).ok()) { + s = Status::OK(); + } + } if (s.ok()) { s = Table::Open(*options_, file, file_size, &table); } diff --git a/src/leveldb/db/version_set.cc b/src/leveldb/db/version_set.cc index 66d73be71f..517edd3b18 100644 --- a/src/leveldb/db/version_set.cc +++ b/src/leveldb/db/version_set.cc @@ -876,12 +876,6 @@ Status VersionSet::LogAndApply(VersionEdit* edit, port::Mutex* mu) { } if (!s.ok()) { Log(options_->info_log, "MANIFEST write: %s\n", s.ToString().c_str()); - if (ManifestContains(record)) { - Log(options_->info_log, - "MANIFEST contains log record despite error; advancing to new " - "version to prevent mismatch between in-memory and logged state"); - s = Status::OK(); - } } } @@ -889,8 +883,6 @@ Status VersionSet::LogAndApply(VersionEdit* edit, port::Mutex* mu) { // new CURRENT file that points to it. if (s.ok() && !new_manifest_file.empty()) { s = SetCurrentFile(env_, dbname_, manifest_file_number_); - // No need to double-check MANIFEST in case of error since it - // will be discarded below. } mu->Lock(); @@ -1124,31 +1116,6 @@ const char* VersionSet::LevelSummary(LevelSummaryStorage* scratch) const { return scratch->buffer; } -// Return true iff the manifest contains the specified record. -bool VersionSet::ManifestContains(const std::string& record) const { - std::string fname = DescriptorFileName(dbname_, manifest_file_number_); - Log(options_->info_log, "ManifestContains: checking %s\n", fname.c_str()); - SequentialFile* file = NULL; - Status s = env_->NewSequentialFile(fname, &file); - if (!s.ok()) { - Log(options_->info_log, "ManifestContains: %s\n", s.ToString().c_str()); - return false; - } - log::Reader reader(file, NULL, true/*checksum*/, 0); - Slice r; - std::string scratch; - bool result = false; - while (reader.ReadRecord(&r, &scratch)) { - if (r == Slice(record)) { - result = true; - break; - } - } - delete file; - Log(options_->info_log, "ManifestContains: result = %d\n", result ? 1 : 0); - return result; -} - uint64_t VersionSet::ApproximateOffsetOf(Version* v, const InternalKey& ikey) { uint64_t result = 0; for (int level = 0; level < config::kNumLevels; level++) { diff --git a/src/leveldb/db/version_set.h b/src/leveldb/db/version_set.h index 20de0e2629..8dc14b8e01 100644 --- a/src/leveldb/db/version_set.h +++ b/src/leveldb/db/version_set.h @@ -292,8 +292,6 @@ class VersionSet { void AppendVersion(Version* v); - bool ManifestContains(const std::string& record) const; - Env* const env_; const std::string dbname_; const Options* const options_; diff --git a/src/leveldb/doc/impl.html b/src/leveldb/doc/impl.html index e870795d23..28817fe0da 100644 --- a/src/leveldb/doc/impl.html +++ b/src/leveldb/doc/impl.html @@ -11,7 +11,7 @@ The implementation of leveldb is similar in spirit to the representation of a single -<a href="http://labs.google.com/papers/bigtable.html"> +<a href="http://research.google.com/archive/bigtable.html"> Bigtable tablet (section 5.3)</a>. However the organization of the files that make up the representation is somewhat different and is explained below. diff --git a/src/leveldb/include/leveldb/db.h b/src/leveldb/include/leveldb/db.h index 57c00a5da0..5ffb29d526 100644 --- a/src/leveldb/include/leveldb/db.h +++ b/src/leveldb/include/leveldb/db.h @@ -14,7 +14,7 @@ namespace leveldb { // Update Makefile if you change these static const int kMajorVersion = 1; -static const int kMinorVersion = 13; +static const int kMinorVersion = 15; struct Options; struct ReadOptions; diff --git a/src/leveldb/include/leveldb/env.h b/src/leveldb/include/leveldb/env.h index fa32289f58..b2072d02c1 100644 --- a/src/leveldb/include/leveldb/env.h +++ b/src/leveldb/include/leveldb/env.h @@ -13,9 +13,9 @@ #ifndef STORAGE_LEVELDB_INCLUDE_ENV_H_ #define STORAGE_LEVELDB_INCLUDE_ENV_H_ -#include <cstdarg> #include <string> #include <vector> +#include <stdarg.h> #include <stdint.h> #include "leveldb/status.h" diff --git a/src/leveldb/issues/issue200_test.cc b/src/leveldb/issues/issue200_test.cc new file mode 100644 index 0000000000..1cec79f443 --- /dev/null +++ b/src/leveldb/issues/issue200_test.cc @@ -0,0 +1,59 @@ +// Copyright (c) 2013 The LevelDB Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. See the AUTHORS file for names of contributors. + +// Test for issue 200: when iterator switches direction from backward +// to forward, the current key can be yielded unexpectedly if a new +// mutation has been added just before the current key. + +#include "leveldb/db.h" +#include "util/testharness.h" + +namespace leveldb { + +class Issue200 { }; + +TEST(Issue200, Test) { + // Get rid of any state from an old run. + std::string dbpath = test::TmpDir() + "/leveldb_issue200_test"; + DestroyDB(dbpath, Options()); + + DB *db; + Options options; + options.create_if_missing = true; + ASSERT_OK(DB::Open(options, dbpath, &db)); + + WriteOptions write_options; + ASSERT_OK(db->Put(write_options, "1", "b")); + ASSERT_OK(db->Put(write_options, "2", "c")); + ASSERT_OK(db->Put(write_options, "3", "d")); + ASSERT_OK(db->Put(write_options, "4", "e")); + ASSERT_OK(db->Put(write_options, "5", "f")); + + ReadOptions read_options; + Iterator *iter = db->NewIterator(read_options); + + // Add an element that should not be reflected in the iterator. + ASSERT_OK(db->Put(write_options, "25", "cd")); + + iter->Seek("5"); + ASSERT_EQ(iter->key().ToString(), "5"); + iter->Prev(); + ASSERT_EQ(iter->key().ToString(), "4"); + iter->Prev(); + ASSERT_EQ(iter->key().ToString(), "3"); + iter->Next(); + ASSERT_EQ(iter->key().ToString(), "4"); + iter->Next(); + ASSERT_EQ(iter->key().ToString(), "5"); + + delete iter; + delete db; + DestroyDB(dbpath, options); +} + +} // namespace leveldb + +int main(int argc, char** argv) { + return leveldb::test::RunAllTests(); +} diff --git a/src/leveldb/port/atomic_pointer.h b/src/leveldb/port/atomic_pointer.h index e17bf435ea..a9866b2302 100644 --- a/src/leveldb/port/atomic_pointer.h +++ b/src/leveldb/port/atomic_pointer.h @@ -50,6 +50,13 @@ namespace port { // http://msdn.microsoft.com/en-us/library/ms684208(v=vs.85).aspx #define LEVELDB_HAVE_MEMORY_BARRIER +// Mac OS +#elif defined(OS_MACOSX) +inline void MemoryBarrier() { + OSMemoryBarrier(); +} +#define LEVELDB_HAVE_MEMORY_BARRIER + // Gcc on x86 #elif defined(ARCH_CPU_X86_FAMILY) && defined(__GNUC__) inline void MemoryBarrier() { @@ -68,13 +75,6 @@ inline void MemoryBarrier() { } #define LEVELDB_HAVE_MEMORY_BARRIER -// Mac OS -#elif defined(OS_MACOSX) -inline void MemoryBarrier() { - OSMemoryBarrier(); -} -#define LEVELDB_HAVE_MEMORY_BARRIER - // ARM Linux #elif defined(ARCH_CPU_ARM_FAMILY) && defined(__linux__) typedef void (*LinuxKernelMemoryBarrierFunc)(void); diff --git a/src/leveldb/table/filter_block_test.cc b/src/leveldb/table/filter_block_test.cc index 3a2a07cf53..8c4a4741f2 100644 --- a/src/leveldb/table/filter_block_test.cc +++ b/src/leveldb/table/filter_block_test.cc @@ -29,7 +29,7 @@ class TestHashFilter : public FilterPolicy { virtual bool KeyMayMatch(const Slice& key, const Slice& filter) const { uint32_t h = Hash(key.data(), key.size(), 1); - for (int i = 0; i + 4 <= filter.size(); i += 4) { + for (size_t i = 0; i + 4 <= filter.size(); i += 4) { if (h == DecodeFixed32(filter.data() + i)) { return true; } diff --git a/src/leveldb/util/arena.cc b/src/leveldb/util/arena.cc index 9551d6a3a2..9367f71492 100644 --- a/src/leveldb/util/arena.cc +++ b/src/leveldb/util/arena.cc @@ -40,7 +40,7 @@ char* Arena::AllocateFallback(size_t bytes) { } char* Arena::AllocateAligned(size_t bytes) { - const int align = sizeof(void*); // We'll align to pointer size + const int align = (sizeof(void*) > 8) ? sizeof(void*) : 8; assert((align & (align-1)) == 0); // Pointer size should be a power of 2 size_t current_mod = reinterpret_cast<uintptr_t>(alloc_ptr_) & (align-1); size_t slop = (current_mod == 0 ? 0 : align - current_mod); diff --git a/src/leveldb/util/arena.h b/src/leveldb/util/arena.h index 8f7dde226c..73bbf1cb9b 100644 --- a/src/leveldb/util/arena.h +++ b/src/leveldb/util/arena.h @@ -5,9 +5,9 @@ #ifndef STORAGE_LEVELDB_UTIL_ARENA_H_ #define STORAGE_LEVELDB_UTIL_ARENA_H_ -#include <cstddef> #include <vector> #include <assert.h> +#include <stddef.h> #include <stdint.h> namespace leveldb { diff --git a/src/leveldb/util/arena_test.cc b/src/leveldb/util/arena_test.cc index 63d1778034..58e870ec44 100644 --- a/src/leveldb/util/arena_test.cc +++ b/src/leveldb/util/arena_test.cc @@ -40,7 +40,7 @@ TEST(ArenaTest, Simple) { r = arena.Allocate(s); } - for (int b = 0; b < s; b++) { + for (size_t b = 0; b < s; b++) { // Fill the "i"th allocation with a known bit pattern r[b] = i % 256; } @@ -51,10 +51,10 @@ TEST(ArenaTest, Simple) { ASSERT_LE(arena.MemoryUsage(), bytes * 1.10); } } - for (int i = 0; i < allocated.size(); i++) { + for (size_t i = 0; i < allocated.size(); i++) { size_t num_bytes = allocated[i].first; const char* p = allocated[i].second; - for (int b = 0; b < num_bytes; b++) { + for (size_t b = 0; b < num_bytes; b++) { // Check the "i"th allocation for the known bit pattern ASSERT_EQ(int(p[b]) & 0xff, i % 256); } diff --git a/src/leveldb/util/bloom_test.cc b/src/leveldb/util/bloom_test.cc index 0bf8e8d6eb..77fb1b3159 100644 --- a/src/leveldb/util/bloom_test.cc +++ b/src/leveldb/util/bloom_test.cc @@ -126,7 +126,8 @@ TEST(BloomTest, VaryingLengths) { } Build(); - ASSERT_LE(FilterSize(), (length * 10 / 8) + 40) << length; + ASSERT_LE(FilterSize(), static_cast<size_t>((length * 10 / 8) + 40)) + << length; // All added keys must match for (int i = 0; i < length; i++) { diff --git a/src/leveldb/util/coding_test.cc b/src/leveldb/util/coding_test.cc index fb5726e335..521541ea61 100644 --- a/src/leveldb/util/coding_test.cc +++ b/src/leveldb/util/coding_test.cc @@ -112,13 +112,13 @@ TEST(Coding, Varint64) { } std::string s; - for (int i = 0; i < values.size(); i++) { + for (size_t i = 0; i < values.size(); i++) { PutVarint64(&s, values[i]); } const char* p = s.data(); const char* limit = p + s.size(); - for (int i = 0; i < values.size(); i++) { + for (size_t i = 0; i < values.size(); i++) { ASSERT_TRUE(p < limit); uint64_t actual; const char* start = p; @@ -143,7 +143,7 @@ TEST(Coding, Varint32Truncation) { std::string s; PutVarint32(&s, large_value); uint32_t result; - for (int len = 0; len < s.size() - 1; len++) { + for (size_t len = 0; len < s.size() - 1; len++) { ASSERT_TRUE(GetVarint32Ptr(s.data(), s.data() + len, &result) == NULL); } ASSERT_TRUE(GetVarint32Ptr(s.data(), s.data() + s.size(), &result) != NULL); @@ -162,7 +162,7 @@ TEST(Coding, Varint64Truncation) { std::string s; PutVarint64(&s, large_value); uint64_t result; - for (int len = 0; len < s.size() - 1; len++) { + for (size_t len = 0; len < s.size() - 1; len++) { ASSERT_TRUE(GetVarint64Ptr(s.data(), s.data() + len, &result) == NULL); } ASSERT_TRUE(GetVarint64Ptr(s.data(), s.data() + s.size(), &result) != NULL); diff --git a/src/leveldb/util/env_posix.cc b/src/leveldb/util/env_posix.cc index 0f5dcfac5a..93eadb1a4f 100644 --- a/src/leveldb/util/env_posix.cc +++ b/src/leveldb/util/env_posix.cc @@ -176,147 +176,43 @@ class PosixMmapReadableFile: public RandomAccessFile { } }; -// We preallocate up to an extra megabyte and use memcpy to append new -// data to the file. This is safe since we either properly close the -// file before reading from it, or for log files, the reading code -// knows enough to skip zero suffixes. -class PosixMmapFile : public WritableFile { +class PosixWritableFile : public WritableFile { private: std::string filename_; - int fd_; - size_t page_size_; - size_t map_size_; // How much extra memory to map at a time - char* base_; // The mapped region - char* limit_; // Limit of the mapped region - char* dst_; // Where to write next (in range [base_,limit_]) - char* last_sync_; // Where have we synced up to - uint64_t file_offset_; // Offset of base_ in file - - // Have we done an munmap of unsynced data? - bool pending_sync_; - - // Roundup x to a multiple of y - static size_t Roundup(size_t x, size_t y) { - return ((x + y - 1) / y) * y; - } - - size_t TruncateToPageBoundary(size_t s) { - s -= (s & (page_size_ - 1)); - assert((s % page_size_) == 0); - return s; - } - - bool UnmapCurrentRegion() { - bool result = true; - if (base_ != NULL) { - if (last_sync_ < limit_) { - // Defer syncing this data until next Sync() call, if any - pending_sync_ = true; - } - if (munmap(base_, limit_ - base_) != 0) { - result = false; - } - file_offset_ += limit_ - base_; - base_ = NULL; - limit_ = NULL; - last_sync_ = NULL; - dst_ = NULL; - - // Increase the amount we map the next time, but capped at 1MB - if (map_size_ < (1<<20)) { - map_size_ *= 2; - } - } - return result; - } - - bool MapNewRegion() { - assert(base_ == NULL); - if (ftruncate(fd_, file_offset_ + map_size_) < 0) { - return false; - } - void* ptr = mmap(NULL, map_size_, PROT_READ | PROT_WRITE, MAP_SHARED, - fd_, file_offset_); - if (ptr == MAP_FAILED) { - return false; - } - base_ = reinterpret_cast<char*>(ptr); - limit_ = base_ + map_size_; - dst_ = base_; - last_sync_ = base_; - return true; - } + FILE* file_; public: - PosixMmapFile(const std::string& fname, int fd, size_t page_size) - : filename_(fname), - fd_(fd), - page_size_(page_size), - map_size_(Roundup(65536, page_size)), - base_(NULL), - limit_(NULL), - dst_(NULL), - last_sync_(NULL), - file_offset_(0), - pending_sync_(false) { - assert((page_size & (page_size - 1)) == 0); - } - - - ~PosixMmapFile() { - if (fd_ >= 0) { - PosixMmapFile::Close(); + PosixWritableFile(const std::string& fname, FILE* f) + : filename_(fname), file_(f) { } + + ~PosixWritableFile() { + if (file_ != NULL) { + // Ignoring any potential errors + fclose(file_); } } virtual Status Append(const Slice& data) { - const char* src = data.data(); - size_t left = data.size(); - while (left > 0) { - assert(base_ <= dst_); - assert(dst_ <= limit_); - size_t avail = limit_ - dst_; - if (avail == 0) { - if (!UnmapCurrentRegion() || - !MapNewRegion()) { - return IOError(filename_, errno); - } - } - - size_t n = (left <= avail) ? left : avail; - memcpy(dst_, src, n); - dst_ += n; - src += n; - left -= n; + size_t r = fwrite_unlocked(data.data(), 1, data.size(), file_); + if (r != data.size()) { + return IOError(filename_, errno); } return Status::OK(); } virtual Status Close() { - Status s; - size_t unused = limit_ - dst_; - if (!UnmapCurrentRegion()) { - s = IOError(filename_, errno); - } else if (unused > 0) { - // Trim the extra space at the end of the file - if (ftruncate(fd_, file_offset_ - unused) < 0) { - s = IOError(filename_, errno); - } - } - - if (close(fd_) < 0) { - if (s.ok()) { - s = IOError(filename_, errno); - } + Status result; + if (fclose(file_) != 0) { + result = IOError(filename_, errno); } - - fd_ = -1; - base_ = NULL; - limit_ = NULL; - return s; + file_ = NULL; + return result; } virtual Status Flush() { + if (fflush_unlocked(file_) != 0) { + return IOError(filename_, errno); + } return Status::OK(); } @@ -353,26 +249,10 @@ class PosixMmapFile : public WritableFile { if (!s.ok()) { return s; } - - if (pending_sync_) { - // Some unmapped data was not synced - pending_sync_ = false; - if (fdatasync(fd_) < 0) { - s = IOError(filename_, errno); - } + if (fflush_unlocked(file_) != 0 || + fdatasync(fileno(file_)) != 0) { + s = Status::IOError(filename_, strerror(errno)); } - - if (dst_ > last_sync_) { - // Find the beginnings of the pages that contain the first and last - // bytes to be synced. - size_t p1 = TruncateToPageBoundary(last_sync_ - base_); - size_t p2 = TruncateToPageBoundary(dst_ - base_ - 1); - last_sync_ = dst_; - if (msync(base_ + p1, p2 - p1 + page_size_, MS_SYNC) < 0) { - s = IOError(filename_, errno); - } - } - return s; } }; @@ -463,12 +343,12 @@ class PosixEnv : public Env { virtual Status NewWritableFile(const std::string& fname, WritableFile** result) { Status s; - const int fd = open(fname.c_str(), O_CREAT | O_RDWR | O_TRUNC, 0644); - if (fd < 0) { + FILE* f = fopen(fname.c_str(), "w"); + if (f == NULL) { *result = NULL; s = IOError(fname, errno); } else { - *result = new PosixMmapFile(fname, fd, page_size_); + *result = new PosixWritableFile(fname, f); } return s; } @@ -631,7 +511,6 @@ class PosixEnv : public Env { return NULL; } - size_t page_size_; pthread_mutex_t mu_; pthread_cond_t bgsignal_; pthread_t bgthread_; @@ -646,8 +525,7 @@ class PosixEnv : public Env { MmapLimiter mmap_limit_; }; -PosixEnv::PosixEnv() : page_size_(getpagesize()), - started_bgthread_(false) { +PosixEnv::PosixEnv() : started_bgthread_(false) { PthreadCall("mutex_init", pthread_mutex_init(&mu_, NULL)); PthreadCall("cvar_init", pthread_cond_init(&bgsignal_, NULL)); } diff --git a/src/leveldb/util/testharness.cc b/src/leveldb/util/testharness.cc index eb1bdd554a..402fab34d7 100644 --- a/src/leveldb/util/testharness.cc +++ b/src/leveldb/util/testharness.cc @@ -38,7 +38,7 @@ int RunAllTests() { int num = 0; if (tests != NULL) { - for (int i = 0; i < tests->size(); i++) { + for (size_t i = 0; i < tests->size(); i++) { const Test& t = (*tests)[i]; if (matcher != NULL) { std::string name = t.base; diff --git a/src/leveldb/util/testutil.cc b/src/leveldb/util/testutil.cc index 538d09516d..bee56bf75f 100644 --- a/src/leveldb/util/testutil.cc +++ b/src/leveldb/util/testutil.cc @@ -32,7 +32,7 @@ std::string RandomKey(Random* rnd, int len) { extern Slice CompressibleString(Random* rnd, double compressed_fraction, - int len, std::string* dst) { + size_t len, std::string* dst) { int raw = static_cast<int>(len * compressed_fraction); if (raw < 1) raw = 1; std::string raw_data; diff --git a/src/leveldb/util/testutil.h b/src/leveldb/util/testutil.h index 824e655bd2..adad3fc1ea 100644 --- a/src/leveldb/util/testutil.h +++ b/src/leveldb/util/testutil.h @@ -24,7 +24,7 @@ extern std::string RandomKey(Random* rnd, int len); // "N*compressed_fraction" bytes and return a Slice that references // the generated data. extern Slice CompressibleString(Random* rnd, double compressed_fraction, - int len, std::string* dst); + size_t len, std::string* dst); // A wrapper that allows injection of errors. class ErrorEnv : public EnvWrapper { diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 67385588e0..b74452d4c6 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -146,14 +146,14 @@ static void initTranslations(QTranslator &qtTranslatorBase, QTranslator &qtTrans void DebugMessageHandler(QtMsgType type, const char *msg) { Q_UNUSED(type); - LogPrint("qt", "Bitcoin-Qt: %s\n", msg); + LogPrint("qt", "GUI: %s\n", msg); } #else void DebugMessageHandler(QtMsgType type, const QMessageLogContext& context, const QString &msg) { Q_UNUSED(type); Q_UNUSED(context); - LogPrint("qt", "Bitcoin-Qt: %s\n", qPrintable(msg)); + LogPrint("qt", "GUI: %s\n", qPrintable(msg)); } #endif @@ -347,7 +347,7 @@ int main(int argc, char *argv[]) guiref = 0; delete walletModel; } - // Shutdown the core and its threads, but don't exit Bitcoin-Qt here + // Shutdown the core and its threads, but don't exit the GUI here threadGroup.interrupt_all(); threadGroup.join_all(); Shutdown(); diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 180c44ad59..2c40310de0 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -71,7 +71,7 @@ BitcoinGUI::BitcoinGUI(bool fIsTestnet, QWidget *parent) : if (!fIsTestnet) { - setWindowTitle(tr("Bitcoin") + " - " + tr("Wallet")); + setWindowTitle(tr("Bitcoin Core") + " - " + tr("Wallet")); #ifndef Q_OS_MAC QApplication::setWindowIcon(QIcon(":icons/bitcoin")); setWindowIcon(QIcon(":icons/bitcoin")); @@ -81,7 +81,7 @@ BitcoinGUI::BitcoinGUI(bool fIsTestnet, QWidget *parent) : } else { - setWindowTitle(tr("Bitcoin") + " - " + tr("Wallet") + " " + tr("[testnet]")); + setWindowTitle(tr("Bitcoin Core") + " - " + tr("Wallet") + " " + tr("[testnet]")); #ifndef Q_OS_MAC QApplication::setWindowIcon(QIcon(":icons/bitcoin_testnet")); setWindowIcon(QIcon(":icons/bitcoin_testnet")); @@ -229,9 +229,9 @@ void BitcoinGUI::createActions(bool fIsTestnet) quitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q)); quitAction->setMenuRole(QAction::QuitRole); if (!fIsTestnet) - aboutAction = new QAction(QIcon(":/icons/bitcoin"), tr("&About Bitcoin"), this); + aboutAction = new QAction(QIcon(":/icons/bitcoin"), tr("&About Bitcoin Core"), this); else - aboutAction = new QAction(QIcon(":/icons/bitcoin_testnet"), tr("&About Bitcoin"), this); + aboutAction = new QAction(QIcon(":/icons/bitcoin_testnet"), tr("&About Bitcoin Core"), this); aboutAction->setStatusTip(tr("Show information about Bitcoin")); aboutAction->setMenuRole(QAction::AboutRole); #if QT_VERSION < 0x050000 diff --git a/src/qt/bitcoinstrings.cpp b/src/qt/bitcoinstrings.cpp index 45a9bf6a41..183a98061d 100644 --- a/src/qt/bitcoinstrings.cpp +++ b/src/qt/bitcoinstrings.cpp @@ -61,8 +61,9 @@ QT_TRANSLATE_NOOP("bitcoin-core", "" "Number of seconds to keep misbehaving peers from reconnecting (default: " "86400)"), QT_TRANSLATE_NOOP("bitcoin-core", "" -"Set maximum size of high-priority/low-fee transactions in bytes (default: " -"27000)"), +"Output debugging information (default: 0, supplying <category> is optional)"), +QT_TRANSLATE_NOOP("bitcoin-core", "" +"Set maximum size of high-priority/low-fee transactions in bytes (default: %d)"), QT_TRANSLATE_NOOP("bitcoin-core", "" "Set the number of script verification threads (up to 16, 0 = auto, <0 = " "leave that many cores free, default: 0)"), @@ -72,6 +73,9 @@ QT_TRANSLATE_NOOP("bitcoin-core", "" QT_TRANSLATE_NOOP("bitcoin-core", "" "Unable to bind to %s on this computer. Bitcoin is probably already running."), QT_TRANSLATE_NOOP("bitcoin-core", "" +"Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -" +"proxy)"), +QT_TRANSLATE_NOOP("bitcoin-core", "" "Warning: -paytxfee is set very high! This is the transaction fee you will " "pay if you send a transaction."), QT_TRANSLATE_NOOP("bitcoin-core", "" @@ -95,21 +99,22 @@ QT_TRANSLATE_NOOP("bitcoin-core", "" "%s\n" "If the file does not exist, create it with owner-readable-only file " "permissions."), +QT_TRANSLATE_NOOP("bitcoin-core", "<category> can be:"), QT_TRANSLATE_NOOP("bitcoin-core", "Accept command line and JSON-RPC commands"), QT_TRANSLATE_NOOP("bitcoin-core", "Accept connections from outside (default: 1 if no -proxy or -connect)"), QT_TRANSLATE_NOOP("bitcoin-core", "Add a node to connect to and attempt to keep the connection open"), QT_TRANSLATE_NOOP("bitcoin-core", "Allow DNS lookups for -addnode, -seednode and -connect"), QT_TRANSLATE_NOOP("bitcoin-core", "Allow JSON-RPC connections from specified IP address"), QT_TRANSLATE_NOOP("bitcoin-core", "Attempt to recover private keys from a corrupt wallet.dat"), +QT_TRANSLATE_NOOP("bitcoin-core", "Bitcoin Core Daemon"), QT_TRANSLATE_NOOP("bitcoin-core", "Bitcoin RPC client version"), -QT_TRANSLATE_NOOP("bitcoin-core", "Bitcoin version"), QT_TRANSLATE_NOOP("bitcoin-core", "Block creation options:"), QT_TRANSLATE_NOOP("bitcoin-core", "Cannot downgrade wallet"), QT_TRANSLATE_NOOP("bitcoin-core", "Cannot resolve -bind address: '%s'"), QT_TRANSLATE_NOOP("bitcoin-core", "Cannot resolve -externalip address: '%s'"), QT_TRANSLATE_NOOP("bitcoin-core", "Cannot write default address"), QT_TRANSLATE_NOOP("bitcoin-core", "Connect only to the specified node(s)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Connect through socks proxy"), +QT_TRANSLATE_NOOP("bitcoin-core", "Connect through SOCKS proxy"), QT_TRANSLATE_NOOP("bitcoin-core", "Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332)"), QT_TRANSLATE_NOOP("bitcoin-core", "Connect to a node to retrieve peer addresses, and disconnect"), QT_TRANSLATE_NOOP("bitcoin-core", "Corrupted block database detected"), @@ -138,12 +143,13 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Failed to write file info"), QT_TRANSLATE_NOOP("bitcoin-core", "Failed to write to coin database"), QT_TRANSLATE_NOOP("bitcoin-core", "Failed to write transaction index"), QT_TRANSLATE_NOOP("bitcoin-core", "Failed to write undo data"), -QT_TRANSLATE_NOOP("bitcoin-core", "Fee per KB to add to transactions you send"), +QT_TRANSLATE_NOOP("bitcoin-core", "Fee per kB to add to transactions you send"), QT_TRANSLATE_NOOP("bitcoin-core", "Find peers using DNS lookup (default: 1 unless -connect)"), QT_TRANSLATE_NOOP("bitcoin-core", "Generate coins (default: 0)"), QT_TRANSLATE_NOOP("bitcoin-core", "Get help for a command"), QT_TRANSLATE_NOOP("bitcoin-core", "How many blocks to check at startup (default: 288, 0 = all)"), QT_TRANSLATE_NOOP("bitcoin-core", "How thorough the block verification is (0-4, default: 3)"), +QT_TRANSLATE_NOOP("bitcoin-core", "If <category> is not supplied, output all debugging information."), QT_TRANSLATE_NOOP("bitcoin-core", "Imports blocks from external blk000??.dat file"), QT_TRANSLATE_NOOP("bitcoin-core", "Incorrect or no genesis block found. Wrong datadir for network?"), QT_TRANSLATE_NOOP("bitcoin-core", "Information"), @@ -167,16 +173,15 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Not enough file descriptors available."), QT_TRANSLATE_NOOP("bitcoin-core", "Only accept block chain matching built-in checkpoints (default: 1)"), QT_TRANSLATE_NOOP("bitcoin-core", "Only connect to nodes in network <net> (IPv4, IPv6 or Tor)"), QT_TRANSLATE_NOOP("bitcoin-core", "Options:"), -QT_TRANSLATE_NOOP("bitcoin-core", "Output extra debugging information. Implies all other -debug* options"), -QT_TRANSLATE_NOOP("bitcoin-core", "Output extra network debugging information"), QT_TRANSLATE_NOOP("bitcoin-core", "Password for JSON-RPC connections"), -QT_TRANSLATE_NOOP("bitcoin-core", "Prepend debug output with timestamp"), +QT_TRANSLATE_NOOP("bitcoin-core", "Prepend debug output with timestamp (default: 1)"), +QT_TRANSLATE_NOOP("bitcoin-core", "RPC client options:"), QT_TRANSLATE_NOOP("bitcoin-core", "Rebuild block chain index from current blk000??.dat files"), QT_TRANSLATE_NOOP("bitcoin-core", "Rescan the block chain for missing wallet transactions"), QT_TRANSLATE_NOOP("bitcoin-core", "Rescanning..."), QT_TRANSLATE_NOOP("bitcoin-core", "Run in the background as a daemon and accept commands"), QT_TRANSLATE_NOOP("bitcoin-core", "SSL options: (see the Bitcoin Wiki for SSL setup instructions)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Select the version of socks proxy to use (4-5, default: 5)"), +QT_TRANSLATE_NOOP("bitcoin-core", "Select SOCKS version for -proxy (4 or 5, default: 5)"), QT_TRANSLATE_NOOP("bitcoin-core", "Send command to Bitcoin server"), QT_TRANSLATE_NOOP("bitcoin-core", "Send commands to node running on <ip> (default: 127.0.0.1)"), QT_TRANSLATE_NOOP("bitcoin-core", "Send trace/debug info to console instead of debug.log file"), @@ -185,7 +190,7 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Server certificate file (default: server.cert QT_TRANSLATE_NOOP("bitcoin-core", "Server private key (default: server.pem)"), QT_TRANSLATE_NOOP("bitcoin-core", "Set database cache size in megabytes (default: 25)"), QT_TRANSLATE_NOOP("bitcoin-core", "Set key pool size to <n> (default: 100)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Set maximum block size in bytes (default: 250000)"), +QT_TRANSLATE_NOOP("bitcoin-core", "Set maximum block size in bytes (default: %d)"), QT_TRANSLATE_NOOP("bitcoin-core", "Set minimum block size in bytes (default: 0)"), QT_TRANSLATE_NOOP("bitcoin-core", "Set the number of threads to service RPC calls (default: 4)"), QT_TRANSLATE_NOOP("bitcoin-core", "Shrink debug.log file on client startup (default: 1 when no -debug)"), @@ -213,15 +218,17 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Usage:"), QT_TRANSLATE_NOOP("bitcoin-core", "Use OpenSSL (https) for JSON-RPC connections"), QT_TRANSLATE_NOOP("bitcoin-core", "Use UPnP to map the listening port (default: 0)"), QT_TRANSLATE_NOOP("bitcoin-core", "Use UPnP to map the listening port (default: 1 when listening)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Use proxy to reach tor hidden services (default: same as -proxy)"), QT_TRANSLATE_NOOP("bitcoin-core", "Use the test network"), QT_TRANSLATE_NOOP("bitcoin-core", "Username for JSON-RPC connections"), QT_TRANSLATE_NOOP("bitcoin-core", "Verifying blocks..."), QT_TRANSLATE_NOOP("bitcoin-core", "Verifying wallet..."), +QT_TRANSLATE_NOOP("bitcoin-core", "Wait for RPC server to start"), QT_TRANSLATE_NOOP("bitcoin-core", "Wallet %s resides outside data directory %s"), QT_TRANSLATE_NOOP("bitcoin-core", "Wallet needed to be rewritten: restart Bitcoin to complete"), QT_TRANSLATE_NOOP("bitcoin-core", "Warning"), +QT_TRANSLATE_NOOP("bitcoin-core", "Warning: Deprecated argument -debugnet ignored, use -debug=net"), QT_TRANSLATE_NOOP("bitcoin-core", "Warning: This version is obsolete, upgrade required!"), QT_TRANSLATE_NOOP("bitcoin-core", "You need to rebuild the database using -reindex to change -txindex"), +QT_TRANSLATE_NOOP("bitcoin-core", "version"), QT_TRANSLATE_NOOP("bitcoin-core", "wallet.dat corrupt, salvage failed"), }; diff --git a/src/qt/coincontroldialog.cpp b/src/qt/coincontroldialog.cpp index 14e5b07133..b4e6aeb1dd 100644 --- a/src/qt/coincontroldialog.cpp +++ b/src/qt/coincontroldialog.cpp @@ -20,7 +20,6 @@ #include <QCheckBox> #include <QColor> #include <QCursor> -#include <QDateTime> #include <QDialogButtonBox> #include <QFlags> #include <QIcon> @@ -730,7 +729,7 @@ void CoinControlDialog::updateView() itemOutput->setText(COLUMN_AMOUNT_INT64, strPad(QString::number(out.tx->vout[out.i].nValue), 15, " ")); // padding so that sorting works correctly // date - itemOutput->setText(COLUMN_DATE, QDateTime::fromTime_t(out.tx->GetTxTime()).toString("yy-MM-dd hh:mm")); + itemOutput->setText(COLUMN_DATE, GUIUtil::dateTimeStr(out.tx->GetTxTime())); // confirmations itemOutput->setText(COLUMN_CONFIRMATIONS, strPad(QString::number(out.nDepth), 8, " ")); diff --git a/src/qt/forms/aboutdialog.ui b/src/qt/forms/aboutdialog.ui index 80768f89b0..10a5857cab 100644 --- a/src/qt/forms/aboutdialog.ui +++ b/src/qt/forms/aboutdialog.ui @@ -11,7 +11,7 @@ </rect> </property> <property name="windowTitle"> - <string>About Bitcoin</string> + <string>About Bitcoin Core</string> </property> <layout class="QHBoxLayout" name="horizontalLayout_2"> <item> @@ -50,7 +50,7 @@ <cursorShape>IBeamCursor</cursorShape> </property> <property name="text"> - <string><b>Bitcoin</b> version</string> + <string><b>Bitcoin Core</b> version</string> </property> <property name="textInteractionFlags"> <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> @@ -91,7 +91,7 @@ <cursorShape>IBeamCursor</cursorShape> </property> <property name="text"> - <string notr="true">Copyright &copy; 2009-YYYY The Bitcoin developers</string> + <string notr="true">Copyright &copy; 2009-YYYY The Bitcoin Core developers</string> </property> <property name="textFormat"> <enum>Qt::RichText</enum> diff --git a/src/qt/forms/intro.ui b/src/qt/forms/intro.ui index 0f6ae5a7d0..05ee9466c4 100644 --- a/src/qt/forms/intro.ui +++ b/src/qt/forms/intro.ui @@ -20,7 +20,7 @@ <string notr="true">QLabel { font-style:italic; }</string> </property> <property name="text"> - <string>Welcome to Bitcoin-Qt.</string> + <string>Welcome to Bitcoin Core.</string> </property> <property name="wordWrap"> <bool>true</bool> @@ -46,7 +46,7 @@ <item> <widget class="QLabel" name="label_4"> <property name="text"> - <string>As this is the first time the program is launched, you can choose where Bitcoin-Qt will store its data.</string> + <string>As this is the first time the program is launched, you can choose where Bitcoin Core will store its data.</string> </property> <property name="wordWrap"> <bool>true</bool> @@ -56,7 +56,7 @@ <item> <widget class="QLabel" name="sizeWarningLabel"> <property name="text"> - <string>Bitcoin-Qt will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory.</string> + <string>Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory.</string> </property> <property name="wordWrap"> <bool>true</bool> diff --git a/src/qt/forms/rpcconsole.ui b/src/qt/forms/rpcconsole.ui index c77c5a384c..83e51b275e 100644 --- a/src/qt/forms/rpcconsole.ui +++ b/src/qt/forms/rpcconsole.ui @@ -36,7 +36,7 @@ </font> </property> <property name="text"> - <string>Bitcoin Core</string> + <string>General</string> </property> </widget> </item> @@ -348,7 +348,7 @@ <item row="17" column="0"> <widget class="QPushButton" name="showCLOptionsButton"> <property name="toolTip"> - <string>Show the Bitcoin-Qt help message to get a list with possible Bitcoin command-line options.</string> + <string>Show the Bitcoin-Core help message to get a list with possible Bitcoin command-line options.</string> </property> <property name="text"> <string>&Show</string> diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index 8f8d67dc58..b87498402d 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -594,7 +594,7 @@ void restoreWindowGeometry(const QString& strSetting, const QSize& defaultSize, HelpMessageBox::HelpMessageBox(QWidget *parent) : QMessageBox(parent) { - header = tr("Bitcoin-Qt") + " " + tr("version") + " " + + header = tr("Bitcoin Core") + " " + tr("version") + " " + QString::fromStdString(FormatFullVersion()) + "\n\n" + tr("Usage:") + "\n" + " bitcoin-qt [" + tr("command-line options") + "] " + "\n"; @@ -607,7 +607,7 @@ HelpMessageBox::HelpMessageBox(QWidget *parent) : " -splash " + tr("Show splash screen on startup (default: 1)") + "\n" + " -choosedatadir " + tr("Choose data directory on startup (default: 0)") + "\n"; - setWindowTitle(tr("Bitcoin-Qt")); + setWindowTitle(tr("Bitcoin Core")); setTextFormat(Qt::PlainText); // setMinimumWidth is ignored for QMessageBox so put in non-breaking spaces to make it wider. setText(header + QString(QChar(0x2003)).repeated(50)); diff --git a/src/qt/locale/bitcoin_en.ts b/src/qt/locale/bitcoin_en.ts index 0dc56ac5dc..368a4d6003 100644 --- a/src/qt/locale/bitcoin_en.ts +++ b/src/qt/locale/bitcoin_en.ts @@ -5,13 +5,13 @@ <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> - <source>About Bitcoin</source> - <translation>About Bitcoin</translation> + <source>About Bitcoin Core</source> + <translation type="unfinished"></translation> </message> <message> <location line="+39"/> - <source><b>Bitcoin</b> version</source> - <translation><b>Bitcoin</b> version</translation> + <source><b>Bitcoin Core</b> version</source> + <translation type="unfinished"></translation> </message> <message> <location line="+57"/> @@ -29,7 +29,7 @@ Distributed under the MIT/X11 software license, see the accompanying file COPYIN This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</translation> </message> <message> - <location filename="../aboutdialog.cpp" line="+14"/> + <location filename="../aboutdialog.cpp" line="+19"/> <source>Copyright</source> <translation>Copyright</translation> </message> @@ -72,7 +72,7 @@ This product includes software developed by the OpenSSL Project for use in the O <translation type="unfinished"></translation> </message> <message> - <location filename="../addressbookpage.cpp" line="+72"/> + <location filename="../addressbookpage.cpp" line="+74"/> <source>&Copy Address</source> <translation>&Copy Address</translation> </message> @@ -142,7 +142,7 @@ This product includes software developed by the OpenSSL Project for use in the O <translation>&Edit</translation> </message> <message> - <location line="+197"/> + <location line="+194"/> <source>Export Address List</source> <translation type="unfinished"></translation> </message> @@ -165,7 +165,7 @@ This product includes software developed by the OpenSSL Project for use in the O <context> <name>AddressTableModel</name> <message> - <location filename="../addresstablemodel.cpp" line="+164"/> + <location filename="../addresstablemodel.cpp" line="+168"/> <source>Label</source> <translation>Label</translation> </message> @@ -203,7 +203,7 @@ This product includes software developed by the OpenSSL Project for use in the O <translation>Repeat new passphrase</translation> </message> <message> - <location filename="../askpassphrasedialog.cpp" line="+34"/> + <location filename="../askpassphrasedialog.cpp" line="+40"/> <source>Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>.</source> <translation>Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>.</translation> </message> @@ -324,17 +324,17 @@ This product includes software developed by the OpenSSL Project for use in the O <context> <name>BitcoinGUI</name> <message> - <location filename="../bitcoingui.cpp" line="+250"/> + <location filename="../bitcoingui.cpp" line="+260"/> <source>Sign &message...</source> <translation>Sign &message...</translation> </message> <message> - <location line="+254"/> + <location line="+290"/> <source>Synchronizing with network...</source> <translation>Synchronizing with network...</translation> </message> <message> - <location line="-324"/> + <location line="-360"/> <source>&Overview</source> <translation>&Overview</translation> </message> @@ -400,7 +400,7 @@ This product includes software developed by the OpenSSL Project for use in the O <translation>&Change Passphrase...</translation> </message> <message> - <location line="+259"/> + <location line="+295"/> <source>Importing blocks from disk...</source> <translation>Importing blocks from disk...</translation> </message> @@ -410,7 +410,7 @@ This product includes software developed by the OpenSSL Project for use in the O <translation>Reindexing blocks on disk...</translation> </message> <message> - <location line="-322"/> + <location line="-358"/> <source>Send coins to a Bitcoin address</source> <translation>Send coins to a Bitcoin address</translation> </message> @@ -445,20 +445,18 @@ This product includes software developed by the OpenSSL Project for use in the O <translation>&Verify message...</translation> </message> <message> - <location line="-180"/> - <location line="+6"/> - <location line="+513"/> + <location line="+375"/> <source>Bitcoin</source> <translation>Bitcoin</translation> </message> <message> - <location line="-519"/> - <location line="+6"/> + <location line="-563"/> + <location line="+10"/> <source>Wallet</source> <translation>Wallet</translation> </message> <message> - <location line="+109"/> + <location line="+113"/> <source>&Send</source> <translation>&Send</translation> </message> @@ -468,13 +466,7 @@ This product includes software developed by the OpenSSL Project for use in the O <translation>&Receive</translation> </message> <message> - <location line="+28"/> - <location line="+2"/> - <source>&About Bitcoin</source> - <translation>&About Bitcoin</translation> - </message> - <message> - <location line="+14"/> + <location line="+44"/> <location line="+2"/> <source>&Show / Hide</source> <translation>&Show / Hide</translation> @@ -500,12 +492,12 @@ This product includes software developed by the OpenSSL Project for use in the O <translation>Verify messages to ensure they were signed with specified Bitcoin addresses</translation> </message> <message> - <location line="+35"/> + <location line="+39"/> <source>&File</source> <translation>&File</translation> </message> <message> - <location line="+10"/> + <location line="+11"/> <source>&Settings</source> <translation>&Settings</translation> </message> @@ -520,18 +512,30 @@ This product includes software developed by the OpenSSL Project for use in the O <translation>Tabs toolbar</translation> </message> <message> - <location line="-235"/> - <location line="+294"/> + <location line="-244"/> + <location line="+321"/> <source>[testnet]</source> <translation>[testnet]</translation> </message> <message> - <location line="-177"/> + <location line="-331"/> + <location line="+10"/> + <source>Bitcoin Core</source> + <translation type="unfinished">Bitcoin Core</translation> + </message> + <message> + <location line="+121"/> <source>Request payments (generates QR codes and bitcoin: URIs)</source> <translation type="unfinished"></translation> </message> <message> - <location line="+63"/> + <location line="+27"/> + <location line="+2"/> + <source>&About Bitcoin Core</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+34"/> <source>&Used sending addresses...</source> <translation type="unfinished"></translation> </message> @@ -551,13 +555,23 @@ This product includes software developed by the OpenSSL Project for use in the O <translation type="unfinished"></translation> </message> <message> - <location line="+106"/> + <location line="+2"/> + <source>Open URI...</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Open a bitcoin: URI or payment request</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+126"/> <location line="+5"/> <source>Bitcoin client</source> <translation>Bitcoin client</translation> </message> <message numerus="yes"> - <location line="+120"/> + <location line="+133"/> <source>%n active connection(s) to Bitcoin network</source> <translation> <numerusform>%n active connection to Bitcoin network</numerusform> @@ -677,17 +691,7 @@ Address: %4 </translation> </message> <message> - <location line="+34"/> - <source>URI handling</source> - <translation>URI handling</translation> - </message> - <message> - <location line="+0"/> - <source>URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters.</source> - <translation>URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters.</translation> - </message> - <message> - <location line="+45"/> + <location line="+67"/> <source>Wallet is <b>encrypted</b> and currently <b>unlocked</b></source> <translation>Wallet is <b>encrypted</b> and currently <b>unlocked</b></translation> </message> @@ -697,7 +701,7 @@ Address: %4 <translation>Wallet is <b>encrypted</b> and currently <b>locked</b></translation> </message> <message> - <location filename="../bitcoin.cpp" line="+110"/> + <location filename="../bitcoin.cpp" line="+116"/> <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source> <translation>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</translation> </message> @@ -705,12 +709,299 @@ Address: %4 <context> <name>ClientModel</name> <message> - <location filename="../clientmodel.cpp" line="+115"/> + <location filename="../clientmodel.cpp" line="+119"/> <source>Network Alert</source> <translation>Network Alert</translation> </message> </context> <context> + <name>CoinControlDialog</name> + <message> + <location filename="../forms/coincontroldialog.ui" line="+14"/> + <source>Coin Control Address Selection</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+34"/> + <source>Quantity:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+29"/> + <source>Bytes:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+45"/> + <source>Amount:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+29"/> + <source>Priority:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+45"/> + <source>Fee:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+32"/> + <source>Low Output:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+48"/> + <source>After Fee:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+32"/> + <source>Change:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+63"/> + <source>(un)select all</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+13"/> + <source>Tree mode</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+16"/> + <source>List mode</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+52"/> + <source>Amount</source> + <translation type="unfinished">Amount</translation> + </message> + <message> + <location line="+10"/> + <source>Address</source> + <translation type="unfinished">Address</translation> + </message> + <message> + <location line="+5"/> + <source>Date</source> + <translation type="unfinished">Date</translation> + </message> + <message> + <location line="+5"/> + <source>Confirmations</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>Confirmed</source> + <translation type="unfinished">Confirmed</translation> + </message> + <message> + <location line="+5"/> + <source>Priority</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../coincontroldialog.cpp" line="+42"/> + <source>Copy address</source> + <translation type="unfinished">Copy address</translation> + </message> + <message> + <location line="+1"/> + <source>Copy label</source> + <translation type="unfinished">Copy label</translation> + </message> + <message> + <location line="+1"/> + <location line="+26"/> + <source>Copy amount</source> + <translation type="unfinished">Copy amount</translation> + </message> + <message> + <location line="-25"/> + <source>Copy transaction ID</source> + <translation type="unfinished">Copy transaction ID</translation> + </message> + <message> + <location line="+1"/> + <source>Lock unspent</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Unlock unspent</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+22"/> + <source>Copy quantity</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+2"/> + <source>Copy fee</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Copy after fee</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Copy bytes</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Copy priority</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Copy low output</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Copy change</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+323"/> + <source>highest</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>higher</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>high</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>medium-high</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>medium</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+4"/> + <source>low-medium</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>low</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>lower</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>lowest</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+11"/> + <source>(%1 locked)</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+171"/> + <source>Dust</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+0"/> + <source>yes</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+0"/> + <source>no</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+10"/> + <source>This label turns red, if the transaction size is greater than 1000 bytes.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <location line="+5"/> + <source>This means a fee of at least %1 per kB is required.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="-4"/> + <source>Can vary +/- 1 byte per input.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+2"/> + <source>Transactions with higher priority are more likely to get included into a block.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>This label turns red, if the priority is smaller than "medium"</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>This label turns red, if any recipient receives an amount smaller than %1.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <location line="+4"/> + <source>This means a fee of at least %1 is required.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="-3"/> + <source>Amounts below 0.546 times the minimum relay fee are shown as dust.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+2"/> + <source>This label turns red, if the change is smaller than %1.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+43"/> + <location line="+66"/> + <source>(no label)</source> + <translation type="unfinished">(no label)</translation> + </message> + <message> + <location line="-9"/> + <source>change from %1 (%2)</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>(change)</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> <name>EditAddressDialog</name> <message> <location filename="../forms/editaddressdialog.ui" line="+14"/> @@ -738,7 +1029,7 @@ Address: %4 <translation>&Address</translation> </message> <message> - <location filename="../editaddressdialog.cpp" line="+21"/> + <location filename="../editaddressdialog.cpp" line="+25"/> <source>New receiving address</source> <translation>New receiving address</translation> </message> @@ -781,7 +1072,7 @@ Address: %4 <context> <name>FreespaceChecker</name> <message> - <location filename="../intro.cpp" line="+61"/> + <location filename="../intro.cpp" line="+65"/> <source>A new data directory will be created.</source> <translation>A new data directory will be created.</translation> </message> @@ -809,18 +1100,18 @@ Address: %4 <context> <name>GUIUtil::HelpMessageBox</name> <message> - <location filename="../guiutil.cpp" line="+558"/> - <location line="+13"/> - <source>Bitcoin-Qt</source> - <translation>Bitcoin-Qt</translation> - </message> - <message> - <location line="-13"/> + <location filename="../guiutil.cpp" line="+597"/> <source>version</source> <translation>version</translation> </message> <message> - <location line="+2"/> + <location line="+0"/> + <location line="+13"/> + <source>Bitcoin Core</source> + <translation type="unfinished">Bitcoin Core</translation> + </message> + <message> + <location line="-11"/> <source>Usage:</source> <translation>Usage:</translation> </message> @@ -864,18 +1155,18 @@ Address: %4 </message> <message> <location line="+9"/> - <source>Welcome to Bitcoin-Qt.</source> - <translation>Welcome to Bitcoin-Qt.</translation> + <source>Welcome to Bitcoin Core.</source> + <translation type="unfinished"></translation> </message> <message> <location line="+26"/> - <source>As this is the first time the program is launched, you can choose where Bitcoin-Qt will store its data.</source> - <translation>As this is the first time the program is launched, you can choose where Bitcoin-Qt will store its data.</translation> + <source>As this is the first time the program is launched, you can choose where Bitcoin Core will store its data.</source> + <translation type="unfinished"></translation> </message> <message> <location line="+10"/> - <source>Bitcoin-Qt will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory.</source> - <translation>Bitcoin-Qt will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory.</translation> + <source>Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory.</source> + <translation type="unfinished"></translation> </message> <message> <location line="+10"/> @@ -888,7 +1179,17 @@ Address: %4 <translation>Use a custom data directory:</translation> </message> <message> - <location filename="../intro.cpp" line="+105"/> + <location filename="../intro.cpp" line="+85"/> + <source>Bitcoin</source> + <translation type="unfinished">Bitcoin</translation> + </message> + <message> + <location line="+1"/> + <source>Error: Specified data directory "%1" can not be created.</source> + <translation type="unfinished">Error: Specified data directory "%1" can not be created.</translation> + </message> + <message> + <location line="+19"/> <source>Error</source> <translation>Error</translation> </message> @@ -904,6 +1205,34 @@ Address: %4 </message> </context> <context> + <name>OpenURIDialog</name> + <message> + <location filename="../forms/openuridialog.ui" line="+14"/> + <source>Open URI</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+6"/> + <source>Open payment request from URI or file</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+9"/> + <source>URI:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+11"/> + <source>Select payment request file</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../openuridialog.cpp" line="+47"/> + <source>Select payment request file to open</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> <name>OptionsDialog</name> <message> <location filename="../forms/optionsdialog.ui" line="+14"/> @@ -1061,6 +1390,16 @@ Address: %4 <translation>&Display addresses in transaction list</translation> </message> <message> + <location line="+7"/> + <source>Whether to show coin control features or not.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>Display coin &control features (experts only)</source> + <translation type="unfinished"></translation> + </message> + <message> <location line="+71"/> <source>&OK</source> <translation>&OK</translation> @@ -1076,12 +1415,12 @@ Address: %4 <translation>&Apply</translation> </message> <message> - <location filename="../optionsdialog.cpp" line="+58"/> + <location filename="../optionsdialog.cpp" line="+63"/> <source>default</source> <translation>default</translation> </message> <message> - <location line="+130"/> + <location line="+131"/> <source>Confirm options reset</source> <translation>Confirm options reset</translation> </message> @@ -1122,17 +1461,17 @@ Address: %4 </message> <message> <location line="+50"/> - <location line="+202"/> + <location line="+214"/> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source> <translation>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</translation> </message> <message> - <location line="-131"/> + <location line="-140"/> <source>Unconfirmed:</source> <translation>Unconfirmed:</translation> </message> <message> - <location line="-78"/> + <location line="-81"/> <source>Wallet</source> <translation>Wallet</translation> </message> @@ -1147,12 +1486,12 @@ Address: %4 <translation>Your current spendable balance</translation> </message> <message> - <location line="+29"/> + <location line="+32"/> <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source> <translation>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</translation> </message> <message> - <location line="+13"/> + <location line="+16"/> <source>Immature:</source> <translation>Immature:</translation> </message> @@ -1162,7 +1501,7 @@ Address: %4 <translation>Mined balance that has not yet matured</translation> </message> <message> - <location line="+13"/> + <location line="+16"/> <source>Total:</source> <translation>Total:</translation> </message> @@ -1172,12 +1511,12 @@ Address: %4 <translation>Your current total balance</translation> </message> <message> - <location line="+53"/> + <location line="+56"/> <source><b>Recent transactions</b></source> <translation><b>Recent transactions</b></translation> </message> <message> - <location filename="../overviewpage.cpp" line="+116"/> + <location filename="../overviewpage.cpp" line="+120"/> <location line="+1"/> <source>out of sync</source> <translation>out of sync</translation> @@ -1186,7 +1525,7 @@ Address: %4 <context> <name>PaymentServer</name> <message> - <location filename="../paymentserver.cpp" line="+392"/> + <location filename="../paymentserver.cpp" line="+397"/> <source>URI handling</source> <translation type="unfinished">URI handling</translation> </message> @@ -1196,23 +1535,29 @@ Address: %4 <translation type="unfinished">URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters.</translation> </message> <message> - <location line="+69"/> + <location line="+91"/> <source>Requested payment amount of %1 is too small (considered dust).</source> <translation type="unfinished"></translation> </message> <message> - <location line="+4"/> - <location line="+37"/> + <location line="-204"/> + <location line="+195"/> + <location line="+13"/> <source>Payment request error</source> <translation type="unfinished"></translation> </message> <message> - <location line="+1"/> - <source>Insecure requests to custom payment scripts unsupported</source> + <location line="-207"/> + <source>Cannot start bitcoin: click-to-pay handler</source> <translation type="unfinished"></translation> </message> <message> - <location line="+38"/> + <location line="+195"/> + <source>Unverified payment requests to custom payment scripts are unsupported.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+59"/> <source>Refund from %1</source> <translation type="unfinished"></translation> </message> @@ -1222,7 +1567,7 @@ Address: %4 <translation type="unfinished"></translation> </message> <message> - <location line="+31"/> + <location line="+28"/> <source>Bad response from server %1</source> <translation type="unfinished"></translation> </message> @@ -1232,8 +1577,8 @@ Address: %4 <translation type="unfinished"></translation> </message> <message> - <location line="-58"/> - <location line="+30"/> + <location line="-55"/> + <location line="+27"/> <location line="+17"/> <source>Network request error</source> <translation type="unfinished"></translation> @@ -1242,9 +1587,8 @@ Address: %4 <context> <name>QObject</name> <message> - <location filename="../bitcoin.cpp" line="+114"/> + <location filename="../bitcoin.cpp" line="+119"/> <location line="+5"/> - <location filename="../intro.cpp" line="-32"/> <source>Bitcoin</source> <translation>Bitcoin</translation> </message> @@ -1258,16 +1602,11 @@ Address: %4 <source>Error: Invalid combination of -regtest and -testnet.</source> <translation type="unfinished"></translation> </message> - <message> - <location filename="../intro.cpp" line="+1"/> - <source>Error: Specified data directory "%1" can not be created.</source> - <translation>Error: Specified data directory "%1" can not be created.</translation> - </message> </context> <context> <name>QRImageWidget</name> <message> - <location filename="../receiverequestdialog.cpp" line="+32"/> + <location filename="../receiverequestdialog.cpp" line="+36"/> <source>&Save Image...</source> <translation type="unfinished"></translation> </message> @@ -1283,8 +1622,8 @@ Address: %4 </message> <message> <location line="+0"/> - <source>PNG Images (*.png)</source> - <translation type="unfinished">PNG Images (*.png)</translation> + <source>PNG Image (*.png)</source> + <translation type="unfinished"></translation> </message> </context> <context> @@ -1304,7 +1643,7 @@ Address: %4 <location line="+53"/> <location line="+23"/> <location line="+23"/> - <location filename="../rpcconsole.cpp" line="+352"/> + <location filename="../rpcconsole.cpp" line="+360"/> <source>N/A</source> <translation>N/A</translation> </message> @@ -1319,7 +1658,12 @@ Address: %4 <translation>&Information</translation> </message> <message> - <location line="+68"/> + <location line="-10"/> + <source>Debug window</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+78"/> <source>Using OpenSSL version</source> <translation>Using OpenSSL version</translation> </message> @@ -1374,12 +1718,7 @@ Address: %4 <translation>Command-line options</translation> </message> <message> - <location line="+7"/> - <source>Show the Bitcoin-Qt help message to get a list with possible Bitcoin command-line options.</source> - <translation>Show the Bitcoin-Qt help message to get a list with possible Bitcoin command-line options.</translation> - </message> - <message> - <location line="+3"/> + <location line="+10"/> <source>&Show</source> <translation>&Show</translation> </message> @@ -1419,12 +1758,7 @@ Address: %4 <translation>Build date</translation> </message> <message> - <location line="-104"/> - <source>Bitcoin - Debug window</source> - <translation>Bitcoin - Debug window</translation> - </message> - <message> - <location line="+25"/> + <location line="-79"/> <source>Bitcoin Core</source> <translation>Bitcoin Core</translation> </message> @@ -1439,7 +1773,12 @@ Address: %4 <translation>Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files.</translation> </message> <message> - <location line="+102"/> + <location line="+26"/> + <source>Show the Bitcoin-Core help message to get a list with possible Bitcoin command-line options.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+76"/> <source>Clear console</source> <translation>Clear console</translation> </message> @@ -1497,37 +1836,32 @@ Address: %4 <context> <name>ReceiveCoinsDialog</name> <message> - <location filename="../forms/receivecoinsdialog.ui" line="+22"/> + <location filename="../forms/receivecoinsdialog.ui" line="+83"/> <source>&Amount:</source> <translation type="unfinished"></translation> </message> <message> - <location line="+16"/> + <location line="+19"/> <source>The amount to request</source> <translation type="unfinished"></translation> </message> <message> - <location line="+7"/> + <location line="-32"/> <source>&Label:</source> <translation type="unfinished">&Label:</translation> </message> <message> - <location line="+10"/> - <source>The label to associate with the receiving address</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+7"/> + <location line="-34"/> <source>&Message:</source> <translation type="unfinished"></translation> </message> <message> - <location line="+10"/> + <location line="+20"/> <source>The message to attach to payment request</source> <translation type="unfinished"></translation> </message> <message> - <location line="+14"/> + <location line="-37"/> <source>Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before.</source> <translation type="unfinished"></translation> </message> @@ -1537,12 +1871,17 @@ Address: %4 <translation type="unfinished"></translation> </message> <message> - <location line="+7"/> + <location line="+27"/> + <source>The label to associate with the new receiving address</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+14"/> <source>Use this form to request payments. All fields are optional.</source> <translation type="unfinished"></translation> </message> <message> - <location line="+17"/> + <location line="+56"/> <source>Clear all fields of the form.</source> <translation type="unfinished"></translation> </message> @@ -1556,6 +1895,31 @@ Address: %4 <source>&Request payment</source> <translation type="unfinished"></translation> </message> + <message> + <location line="+47"/> + <source>Previously requested payments</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+12"/> + <source>Show the selected request (does the same as double clicking an entry)</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>Show</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+11"/> + <source>Remove the selected entries from the list</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>Remove</source> + <translation type="unfinished"></translation> + </message> </context> <context> <name>ReceiveRequestDialog</name> @@ -1576,16 +1940,11 @@ Address: %4 </message> <message> <location line="+7"/> - <source>&Copy Image</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+7"/> <source>&Save Image...</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../receiverequestdialog.cpp" line="+58"/> + <location filename="../receiverequestdialog.cpp" line="+56"/> <source>Request payment to %1</source> <translation type="unfinished"></translation> </message> @@ -1631,16 +1990,119 @@ Address: %4 </message> </context> <context> + <name>RecentRequestsTableModel</name> + <message> + <location filename="../recentrequeststablemodel.cpp" line="+14"/> + <source>Date</source> + <translation type="unfinished">Date</translation> + </message> + <message> + <location line="+0"/> + <source>Label</source> + <translation type="unfinished">Label</translation> + </message> + <message> + <location line="+0"/> + <source>Message</source> + <translation type="unfinished">Message</translation> + </message> + <message> + <location line="+0"/> + <source>Amount</source> + <translation type="unfinished">Amount</translation> + </message> + <message> + <location line="+36"/> + <source>(no label)</source> + <translation type="unfinished">(no label)</translation> + </message> + <message> + <location line="+9"/> + <source>(no message)</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> <name>SendCoinsDialog</name> <message> <location filename="../forms/sendcoinsdialog.ui" line="+14"/> - <location filename="../sendcoinsdialog.cpp" line="+140"/> - <location line="+213"/> + <location filename="../sendcoinsdialog.cpp" line="+381"/> + <location line="+81"/> <source>Send Coins</source> <translation>Send Coins</translation> </message> <message> - <location line="+50"/> + <location line="+76"/> + <source>Coin Control Features</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+20"/> + <source>Inputs...</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+7"/> + <source>automatically selected</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+19"/> + <source>Insufficient funds!</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+89"/> + <source>Quantity:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+35"/> + <source>Bytes:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+48"/> + <source>Amount:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+32"/> + <source>Priority:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+48"/> + <source>Fee:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+32"/> + <source>Low Output:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+48"/> + <source>After Fee:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+32"/> + <source>Change:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+44"/> + <source>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>Custom change address</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+115"/> <source>Send to multiple recipients at once</source> <translation>Send to multiple recipients at once</translation> </message> @@ -1665,12 +2127,7 @@ Address: %4 <translation>Balance:</translation> </message> <message> - <location line="+10"/> - <source>123.456 BTC</source> - <translation>123.456 BTC</translation> - </message> - <message> - <location line="+31"/> + <location line="+41"/> <source>Confirm the send action</source> <translation>Confirm the send action</translation> </message> @@ -1680,69 +2137,135 @@ Address: %4 <translation>S&end</translation> </message> <message> - <location filename="../sendcoinsdialog.cpp" line="-154"/> + <location filename="../sendcoinsdialog.cpp" line="-229"/> <source>Confirm send coins</source> <translation>Confirm send coins</translation> </message> <message> - <location line="-90"/> + <location line="-74"/> <location line="+5"/> <location line="+5"/> + <location line="+4"/> <source>%1 to %2</source> <translation type="unfinished"></translation> </message> <message> - <location line="+26"/> + <location line="-136"/> + <source>Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source> + <translation type="unfinished">Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation> + </message> + <message> + <location line="+15"/> + <source>Copy quantity</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Copy amount</source> + <translation type="unfinished">Copy amount</translation> + </message> + <message> + <location line="+1"/> + <source>Copy fee</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Copy after fee</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Copy bytes</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Copy priority</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Copy low output</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Copy change</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+170"/> + <source>Total Amount %1 (= %2)</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+2"/> + <source>or</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+202"/> <source>The recipient address is not valid, please recheck.</source> <translation>The recipient address is not valid, please recheck.</translation> </message> <message> - <location line="+4"/> + <location line="+3"/> <source>The amount to pay must be larger than 0.</source> <translation>The amount to pay must be larger than 0.</translation> </message> <message> - <location line="+4"/> + <location line="+3"/> <source>The amount exceeds your balance.</source> <translation>The amount exceeds your balance.</translation> </message> <message> - <location line="+4"/> + <location line="+3"/> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation>The total exceeds your balance when the %1 transaction fee is included.</translation> </message> <message> - <location line="+5"/> + <location line="+3"/> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation>Duplicate address found, can only send to each address once per send operation.</translation> </message> <message> + <location line="+3"/> + <source>Transaction creation failed!</source> + <translation type="unfinished"></translation> + </message> + <message> <location line="+4"/> - <source>Error: Transaction creation failed!</source> - <translation>Error: Transaction creation failed!</translation> + <source>The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> + <translation type="unfinished"></translation> </message> <message> - <location line="+15"/> - <source>Are you sure you want to send?</source> + <location line="+113"/> + <source>Warning: Invalid Bitcoin address</source> <translation type="unfinished"></translation> </message> <message> - <location line="+9"/> - <source>added as transaction fee</source> + <location line="+13"/> + <source>(no label)</source> + <translation type="unfinished">(no label)</translation> + </message> + <message> + <location line="+8"/> + <source>Warning: Unknown change address</source> <translation type="unfinished"></translation> </message> <message> - <location line="+6"/> - <source>Total Amount %1</source> + <location line="-378"/> + <source>Are you sure you want to send?</source> <translation type="unfinished"></translation> </message> <message> - <location line="+20"/> - <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> - <translation>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</translation> + <location line="+9"/> + <source>added as transaction fee</source> + <translation type="unfinished"></translation> </message> <message> - <location line="+144"/> + <location line="+170"/> <source>Payment request expired</source> <translation type="unfinished"></translation> </message> @@ -1755,39 +2278,44 @@ Address: %4 <context> <name>SendCoinsEntry</name> <message> - <location filename="../forms/sendcoinsentry.ui" line="+33"/> - <location line="+585"/> + <location filename="../forms/sendcoinsentry.ui" line="+131"/> + <location line="+501"/> + <location line="+536"/> <source>A&mount:</source> <translation>A&mount:</translation> </message> <message> - <location line="-572"/> - <location line="+585"/> + <location line="-1132"/> <source>Pay &To:</source> <translation>Pay &To:</translation> </message> <message> - <location line="-551"/> + <location line="+18"/> <source>The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source> <translation>The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation> </message> <message> - <location filename="../sendcoinsentry.cpp" line="+28"/> + <location filename="../sendcoinsentry.cpp" line="+30"/> <source>Enter a label for this address to add it to your address book</source> <translation>Enter a label for this address to add it to your address book</translation> </message> <message> - <location filename="../forms/sendcoinsentry.ui" line="-18"/> + <location filename="../forms/sendcoinsentry.ui" line="+57"/> <source>&Label:</source> <translation>&Label:</translation> </message> <message> - <location line="+28"/> + <location line="-50"/> <source>Choose previously used address</source> <translation type="unfinished"></translation> </message> <message> - <location line="+10"/> + <location line="-40"/> + <source>This is a normal payment.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+50"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> @@ -1803,16 +2331,35 @@ Address: %4 </message> <message> <location line="+7"/> - <source>Remove this recipient</source> - <translation>Remove this recipient</translation> + <location line="+504"/> + <location line="+536"/> + <source>Remove this entry</source> + <translation type="unfinished"></translation> </message> <message> - <location line="+16"/> + <location line="-40"/> + <source>This is a verified payment request.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="-971"/> <source>Enter a label for this address to add it to the list of used addresses</source> <translation type="unfinished"></translation> </message> <message> - <location line="+465"/> + <location line="+439"/> + <source>This is an unverified payment request.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+18"/> + <location line="+532"/> + <source>Pay To:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="-498"/> + <location line="+536"/> <source>Memo:</source> <translation type="unfinished"></translation> </message> @@ -1933,7 +2480,7 @@ Address: %4 <translation>Reset all verify message fields</translation> </message> <message> - <location filename="../signverifymessagedialog.cpp" line="+27"/> + <location filename="../signverifymessagedialog.cpp" line="+29"/> <location line="+3"/> <source>Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source> <translation>Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation> @@ -1949,7 +2496,7 @@ Address: %4 <translation>Enter Bitcoin signature</translation> </message> <message> - <location line="+85"/> + <location line="+84"/> <location line="+81"/> <source>The entered address is invalid.</source> <translation>The entered address is invalid.</translation> @@ -2018,9 +2565,14 @@ Address: %4 <context> <name>SplashScreen</name> <message> - <location filename="../splashscreen.cpp" line="+23"/> - <source>The Bitcoin developers</source> - <translation>The Bitcoin developers</translation> + <location filename="../splashscreen.cpp" line="+26"/> + <source>Bitcoin Core</source> + <translation type="unfinished">Bitcoin Core</translation> + </message> + <message> + <location line="+2"/> + <source>The Bitcoin Core developers</source> + <translation type="unfinished"></translation> </message> <message> <location line="+1"/> @@ -2031,7 +2583,7 @@ Address: %4 <context> <name>TrafficGraphWidget</name> <message> - <location filename="../trafficgraphwidget.cpp" line="+75"/> + <location filename="../trafficgraphwidget.cpp" line="+79"/> <source>KB/s</source> <translation type="unfinished"></translation> </message> @@ -2039,7 +2591,7 @@ Address: %4 <context> <name>TransactionDesc</name> <message> - <location filename="../transactiondesc.cpp" line="+22"/> + <location filename="../transactiondesc.cpp" line="+28"/> <source>Open until %1</source> <translation>Open until %1</translation> </message> @@ -2240,7 +2792,7 @@ Address: %4 <context> <name>TransactionTableModel</name> <message> - <location filename="../transactiontablemodel.cpp" line="+227"/> + <location filename="../transactiontablemodel.cpp" line="+234"/> <source>Date</source> <translation>Date</translation> </message> @@ -2364,7 +2916,7 @@ Address: %4 <context> <name>TransactionView</name> <message> - <location filename="../transactionview.cpp" line="+52"/> + <location filename="../transactionview.cpp" line="+57"/> <location line="+16"/> <source>All</source> <translation>All</translation> @@ -2425,12 +2977,12 @@ Address: %4 <translation>Other</translation> </message> <message> - <location line="+7"/> + <location line="+6"/> <source>Enter address or label to search</source> <translation>Enter address or label to search</translation> </message> <message> - <location line="+7"/> + <location line="+6"/> <source>Min amount</source> <translation>Min amount</translation> </message> @@ -2465,17 +3017,37 @@ Address: %4 <translation>Show transaction details</translation> </message> <message> - <location line="+143"/> - <source>Export Transaction Data</source> - <translation>Export Transaction Data</translation> + <location line="+142"/> + <source>Export Transaction History</source> + <translation type="unfinished"></translation> </message> <message> - <location line="+1"/> + <location line="+19"/> + <source>Exporting Failed</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+0"/> + <source>There was an error trying to save the transaction history to %1.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+4"/> + <source>Exporting Successful</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+0"/> + <source>The transaction history was successfully saved to %1.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="-22"/> <source>Comma separated file (*.csv)</source> <translation>Comma separated file (*.csv)</translation> </message> <message> - <location line="+8"/> + <location line="+9"/> <source>Confirmed</source> <translation>Confirmed</translation> </message> @@ -2510,17 +3082,7 @@ Address: %4 <translation>ID</translation> </message> <message> - <location line="+4"/> - <source>Error exporting</source> - <translation>Error exporting</translation> - </message> - <message> - <location line="+0"/> - <source>Could not write to file %1.</source> - <translation>Could not write to file %1.</translation> - </message> - <message> - <location line="+100"/> + <location line="+107"/> <source>Range:</source> <translation>Range:</translation> </message> @@ -2531,9 +3093,17 @@ Address: %4 </message> </context> <context> + <name>WalletFrame</name> + <message> + <location filename="../walletframe.cpp" line="+26"/> + <source>No wallet has been loaded.</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> <name>WalletModel</name> <message> - <location filename="../walletmodel.cpp" line="+218"/> + <location filename="../walletmodel.cpp" line="+245"/> <source>Send Coins</source> <translation>Send Coins</translation> </message> @@ -2541,7 +3111,7 @@ Address: %4 <context> <name>WalletView</name> <message> - <location filename="../walletview.cpp" line="+46"/> + <location filename="../walletview.cpp" line="+43"/> <source>&Export</source> <translation>&Export</translation> </message> @@ -2551,65 +3121,60 @@ Address: %4 <translation>Export the data in the current tab to a file</translation> </message> <message> - <location line="+183"/> + <location line="+181"/> <source>Backup Wallet</source> <translation>Backup Wallet</translation> </message> <message> - <location line="+0"/> + <location line="+1"/> <source>Wallet Data (*.dat)</source> <translation>Wallet Data (*.dat)</translation> </message> <message> - <location line="+3"/> + <location line="+6"/> <source>Backup Failed</source> <translation>Backup Failed</translation> </message> <message> <location line="+0"/> - <source>There was an error trying to save the wallet data to the new location.</source> - <translation>There was an error trying to save the wallet data to the new location.</translation> + <source>There was an error trying to save the wallet data to %1.</source> + <translation type="unfinished"></translation> </message> <message> <location line="+4"/> - <source>Backup Successful</source> - <translation>Backup Successful</translation> + <source>The wallet data was successfully saved to %1.</source> + <translation type="unfinished"></translation> </message> <message> <location line="+0"/> - <source>The wallet data was successfully saved to the new location.</source> - <translation>The wallet data was successfully saved to the new location.</translation> + <source>Backup Successful</source> + <translation>Backup Successful</translation> </message> </context> <context> <name>bitcoin-core</name> <message> - <location filename="../bitcoinstrings.cpp" line="+102"/> - <source>Bitcoin version</source> - <translation>Bitcoin version</translation> - </message> - <message> - <location line="+107"/> + <location filename="../bitcoinstrings.cpp" line="+217"/> <source>Usage:</source> <translation>Usage:</translation> </message> <message> - <location line="-55"/> + <location line="-54"/> <source>List commands</source> <translation>List commands</translation> </message> <message> - <location line="-13"/> + <location line="-14"/> <source>Get help for a command</source> <translation>Get help for a command</translation> </message> <message> - <location line="+25"/> + <location line="+26"/> <source>Options:</source> <translation>Options:</translation> </message> <message> - <location line="+24"/> + <location line="+23"/> <source>Specify configuration file (default: bitcoin.conf)</source> <translation>Specify configuration file (default: bitcoin.conf)</translation> </message> @@ -2629,7 +3194,7 @@ Address: %4 <translation>Set database cache size in megabytes (default: 25)</translation> </message> <message> - <location line="-28"/> + <location line="-27"/> <source>Listen for connections on <port> (default: 8333 or testnet: 18333)</source> <translation>Listen for connections on <port> (default: 8333 or testnet: 18333)</translation> </message> @@ -2639,7 +3204,7 @@ Address: %4 <translation>Maintain at most <n> connections to peers (default: 125)</translation> </message> <message> - <location line="-49"/> + <location line="-50"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation>Connect to a node to retrieve peer addresses, and disconnect</translation> </message> @@ -2654,7 +3219,7 @@ Address: %4 <translation>Threshold for disconnecting misbehaving peers (default: 100)</translation> </message> <message> - <location line="-142"/> + <location line="-147"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</translation> </message> @@ -2669,7 +3234,7 @@ Address: %4 <translation>Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332)</translation> </message> <message> - <location line="+40"/> + <location line="+45"/> <source>Accept command line and JSON-RPC commands</source> <translation>Accept command line and JSON-RPC commands</translation> </message> @@ -2679,17 +3244,17 @@ Address: %4 <translation>Run in the background as a daemon and accept commands</translation> </message> <message> - <location line="+40"/> + <location line="+39"/> <source>Use the test network</source> <translation>Use the test network</translation> </message> <message> - <location line="-118"/> + <location line="-117"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation>Accept connections from outside (default: 1 if no -proxy or -connect)</translation> </message> <message> - <location line="-87"/> + <location line="-92"/> <source>%s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: @@ -2754,17 +3319,17 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. <translation>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</translation> </message> <message> - <location line="+11"/> - <source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source> - <translation>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</translation> - </message> - <message> - <location line="+6"/> + <location line="+18"/> <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source> <translation>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</translation> </message> <message> <location line="+5"/> + <source>Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy)</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> <source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source> <translation>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</translation> </message> @@ -2794,17 +3359,27 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. <translation>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</translation> </message> <message> - <location line="+14"/> + <location line="+9"/> + <source><category> can be:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+6"/> <source>Attempt to recover private keys from a corrupt wallet.dat</source> <translation>Attempt to recover private keys from a corrupt wallet.dat</translation> </message> <message> <location line="+1"/> + <source>Bitcoin Core Daemon</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> <source>Bitcoin RPC client version</source> <translation type="unfinished"></translation> </message> <message> - <location line="+2"/> + <location line="+1"/> <source>Block creation options:</source> <translation>Block creation options:</translation> </message> @@ -2814,7 +3389,12 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. <translation>Connect only to the specified node(s)</translation> </message> <message> - <location line="+2"/> + <location line="+1"/> + <source>Connect through SOCKS proxy</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> <source>Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332)</source> <translation type="unfinished"></translation> </message> @@ -2924,7 +3504,12 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. <translation>Failed to write undo data</translation> </message> <message> - <location line="+2"/> + <location line="+1"/> + <source>Fee per kB to add to transactions you send</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> <source>Find peers using DNS lookup (default: 1 unless -connect)</source> <translation>Find peers using DNS lookup (default: 1 unless -connect)</translation> </message> @@ -2944,6 +3529,11 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. <translation>How thorough the block verification is (0-4, default: 3)</translation> </message> <message> + <location line="+1"/> + <source>If <category> is not supplied, output all debugging information.</source> + <translation type="unfinished"></translation> + </message> + <message> <location line="+2"/> <source>Incorrect or no genesis block found. Wrong datadir for network?</source> <translation>Incorrect or no genesis block found. Wrong datadir for network?</translation> @@ -2959,17 +3549,37 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. <translation>Not enough file descriptors available.</translation> </message> <message> - <location line="+8"/> + <location line="+5"/> + <source>Prepend debug output with timestamp (default: 1)</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>RPC client options:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> <source>Rebuild block chain index from current blk000??.dat files</source> <translation>Rebuild block chain index from current blk000??.dat files</translation> </message> <message> - <location line="+6"/> + <location line="+5"/> + <source>Select SOCKS version for -proxy (4 or 5, default: 5)</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> <source>Send command to Bitcoin server</source> <translation type="unfinished"></translation> </message> <message> - <location line="+10"/> + <location line="+8"/> + <source>Set maximum block size in bytes (default: %d)</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+2"/> <source>Set the number of threads to service RPC calls (default: 4)</source> <translation>Set the number of threads to service RPC calls (default: 4)</translation> </message> @@ -2989,7 +3599,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. <translation type="unfinished"></translation> </message> <message> - <location line="+8"/> + <location line="+7"/> <source>Verifying blocks...</source> <translation>Verifying blocks...</translation> </message> @@ -3000,11 +3610,21 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. </message> <message> <location line="+1"/> + <source>Wait for RPC server to start</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> <source>Wallet %s resides outside data directory %s</source> <translation>Wallet %s resides outside data directory %s</translation> </message> <message> - <location line="+4"/> + <location line="+3"/> + <source>Warning: Deprecated argument -debugnet ignored, use -debug=net</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+2"/> <source>You need to rebuild the database using -reindex to change -txindex</source> <translation>You need to rebuild the database using -reindex to change -txindex</translation> </message> @@ -3014,17 +3634,27 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. <translation>Imports blocks from external blk000??.dat file</translation> </message> <message> - <location line="-98"/> + <location line="-104"/> <source>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</source> <translation>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</translation> </message> <message> - <location line="+17"/> + <location line="+14"/> + <source>Output debugging information (default: 0, supplying <category> is optional)</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+2"/> + <source>Set maximum size of high-priority/low-fee transactions in bytes (default: %d)</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+2"/> <source>Set the number of script verification threads (up to 16, 0 = auto, <0 = leave that many cores free, default: 0)</source> <translation>Set the number of script verification threads (up to 16, 0 = auto, <0 = leave that many cores free, default: 0)</translation> </message> <message> - <location line="+83"/> + <location line="+88"/> <source>Information</source> <translation>Information</translation> </message> @@ -3064,32 +3694,12 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. <translation>Only connect to nodes in network <net> (IPv4, IPv6 or Tor)</translation> </message> <message> - <location line="+2"/> - <source>Output extra debugging information. Implies all other -debug* options</source> - <translation>Output extra debugging information. Implies all other -debug* options</translation> - </message> - <message> - <location line="+1"/> - <source>Output extra network debugging information</source> - <translation>Output extra network debugging information</translation> - </message> - <message> - <location line="+2"/> - <source>Prepend debug output with timestamp</source> - <translation>Prepend debug output with timestamp</translation> - </message> - <message> - <location line="+5"/> + <location line="+9"/> <source>SSL options: (see the Bitcoin Wiki for SSL setup instructions)</source> <translation>SSL options: (see the Bitcoin Wiki for SSL setup instructions)</translation> </message> <message> - <location line="+1"/> - <source>Select the version of socks proxy to use (4-5, default: 5)</source> - <translation>Select the version of socks proxy to use (4-5, default: 5)</translation> - </message> - <message> - <location line="+3"/> + <location line="+4"/> <source>Send trace/debug info to console instead of debug.log file</source> <translation>Send trace/debug info to console instead of debug.log file</translation> </message> @@ -3099,12 +3709,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. <translation>Send trace/debug info to debugger</translation> </message> <message> - <location line="+5"/> - <source>Set maximum block size in bytes (default: 250000)</source> - <translation>Set maximum block size in bytes (default: 250000)</translation> - </message> - <message> - <location line="+1"/> + <location line="+6"/> <source>Set minimum block size in bytes (default: 0)</source> <translation>Set minimum block size in bytes (default: 0)</translation> </message> @@ -3154,37 +3759,37 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. <translation>Use UPnP to map the listening port (default: 1 when listening)</translation> </message> <message> - <location line="+1"/> - <source>Use proxy to reach tor hidden services (default: same as -proxy)</source> - <translation>Use proxy to reach tor hidden services (default: same as -proxy)</translation> - </message> - <message> <location line="+2"/> <source>Username for JSON-RPC connections</source> <translation>Username for JSON-RPC connections</translation> </message> <message> - <location line="+5"/> + <location line="+6"/> <source>Warning</source> <translation>Warning</translation> </message> <message> - <location line="+1"/> + <location line="+2"/> <source>Warning: This version is obsolete, upgrade required!</source> <translation>Warning: This version is obsolete, upgrade required!</translation> </message> <message> <location line="+2"/> + <source>version</source> + <translation type="unfinished">version</translation> + </message> + <message> + <location line="+1"/> <source>wallet.dat corrupt, salvage failed</source> <translation>wallet.dat corrupt, salvage failed</translation> </message> <message> - <location line="-54"/> + <location line="-57"/> <source>Password for JSON-RPC connections</source> <translation>Password for JSON-RPC connections</translation> </message> <message> - <location line="-70"/> + <location line="-69"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation>Allow JSON-RPC connections from specified IP address</translation> </message> @@ -3194,12 +3799,12 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. <translation>Send commands to node running on <ip> (default: 127.0.0.1)</translation> </message> <message> - <location line="-126"/> + <location line="-131"/> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> <translation>Execute command when the best block changes (%s in cmd is replaced by block hash)</translation> </message> <message> - <location line="+155"/> + <location line="+160"/> <source>Upgrade wallet to latest format</source> <translation>Upgrade wallet to latest format</translation> </message> @@ -3239,22 +3844,17 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. <translation>Unable to bind to %s on this computer (bind returned error %d, %s)</translation> </message> <message> - <location line="-95"/> - <source>Connect through socks proxy</source> - <translation>Connect through socks proxy</translation> - </message> - <message> - <location line="-11"/> + <location line="-106"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation>Allow DNS lookups for -addnode, -seednode and -connect</translation> </message> <message> - <location line="+58"/> + <location line="+59"/> <source>Loading addresses...</source> <translation>Loading addresses...</translation> </message> <message> - <location line="-36"/> + <location line="-37"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation>Error loading wallet.dat: Wallet corrupted</translation> </message> @@ -3274,12 +3874,12 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. <translation>Error loading wallet.dat</translation> </message> <message> - <location line="+30"/> + <location line="+31"/> <source>Invalid -proxy address: '%s'</source> <translation>Invalid -proxy address: '%s'</translation> </message> <message> - <location line="+57"/> + <location line="+56"/> <source>Unknown network specified in -onlynet: '%s'</source> <translation>Unknown network specified in -onlynet: '%s'</translation> </message> @@ -3299,7 +3899,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. <translation>Cannot resolve -externalip address: '%s'</translation> </message> <message> - <location line="+46"/> + <location line="+47"/> <source>Invalid amount for -paytxfee=<amount>: '%s'</source> <translation>Invalid amount for -paytxfee=<amount>: '%s'</translation> </message> @@ -3319,27 +3919,22 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. <translation>Loading block index...</translation> </message> <message> - <location line="-60"/> + <location line="-61"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation>Add a node to connect to and attempt to keep the connection open</translation> </message> <message> - <location line="-28"/> + <location line="-32"/> <source>Unable to bind to %s on this computer. Bitcoin is probably already running.</source> <translation>Unable to bind to %s on this computer. Bitcoin is probably already running.</translation> </message> <message> - <location line="+69"/> - <source>Fee per KB to add to transactions you send</source> - <translation>Fee per KB to add to transactions you send</translation> - </message> - <message> - <location line="+20"/> + <location line="+94"/> <source>Loading wallet...</source> <translation>Loading wallet...</translation> </message> <message> - <location line="-54"/> + <location line="-55"/> <source>Cannot downgrade wallet</source> <translation>Cannot downgrade wallet</translation> </message> @@ -3369,7 +3964,7 @@ for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo. <translation>Error</translation> </message> <message> - <location line="-33"/> + <location line="-34"/> <source>You must set rpcpassword=<password> in the configuration file: %s If the file does not exist, create it with owner-readable-only file permissions.</source> diff --git a/src/qt/recentrequeststablemodel.cpp b/src/qt/recentrequeststablemodel.cpp index 06f64af146..86c29dd02b 100644 --- a/src/qt/recentrequeststablemodel.cpp +++ b/src/qt/recentrequeststablemodel.cpp @@ -3,13 +3,16 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "recentrequeststablemodel.h" -#include "guiutil.h" + #include "bitcoinunits.h" +#include "guiutil.h" #include "optionsmodel.h" -RecentRequestsTableModel::RecentRequestsTableModel(CWallet *wallet, WalletModel *parent): +RecentRequestsTableModel::RecentRequestsTableModel(CWallet *wallet, WalletModel *parent) : walletModel(parent) { + Q_UNUSED(wallet); + /* These columns must match the indices in the ColumnIndex enumeration */ columns << tr("Date") << tr("Label") << tr("Message") << tr("Amount"); } @@ -22,12 +25,14 @@ RecentRequestsTableModel::~RecentRequestsTableModel() int RecentRequestsTableModel::rowCount(const QModelIndex &parent) const { Q_UNUSED(parent); + return list.length(); } int RecentRequestsTableModel::columnCount(const QModelIndex &parent) const { Q_UNUSED(parent); + return columns.length(); } @@ -88,12 +93,15 @@ QVariant RecentRequestsTableModel::headerData(int section, Qt::Orientation orien QModelIndex RecentRequestsTableModel::index(int row, int column, const QModelIndex &parent) const { - return createIndex(row, column, 0); + Q_UNUSED(parent); + + return createIndex(row, column); } bool RecentRequestsTableModel::removeRows(int row, int count, const QModelIndex &parent) { Q_UNUSED(parent); + if(count > 0 && row >= 0 && (row+count) <= list.size()) { beginRemoveRows(parent, row, row + count - 1); diff --git a/src/qt/recentrequeststablemodel.h b/src/qt/recentrequeststablemodel.h index d00a2a9055..3aab7b0a48 100644 --- a/src/qt/recentrequeststablemodel.h +++ b/src/qt/recentrequeststablemodel.h @@ -5,12 +5,12 @@ #ifndef RECENTREQUESTSTABLEMODEL_H #define RECENTREQUESTSTABLEMODEL_H +#include "walletmodel.h" + #include <QAbstractTableModel> #include <QStringList> #include <QDateTime> -#include "walletmodel.h" - class CWallet; struct RecentRequestEntry @@ -27,7 +27,7 @@ class RecentRequestsTableModel: public QAbstractTableModel Q_OBJECT public: - explicit RecentRequestsTableModel(CWallet *wallet, WalletModel *parent = 0); + explicit RecentRequestsTableModel(CWallet *wallet, WalletModel *parent); ~RecentRequestsTableModel(); enum ColumnIndex { diff --git a/src/qt/res/bitcoin-qt-res.rc b/src/qt/res/bitcoin-qt-res.rc index 3e3672a835..ee23ae9b78 100644 --- a/src/qt/res/bitcoin-qt-res.rc +++ b/src/qt/res/bitcoin-qt-res.rc @@ -21,13 +21,13 @@ BEGIN BLOCK "040904E4" // U.S. English - multilingual (hex) BEGIN VALUE "CompanyName", "Bitcoin" - VALUE "FileDescription", "Bitcoin-Qt (OSS GUI client for Bitcoin)" + VALUE "FileDescription", "Bitcoin Core (OSS GUI client for Bitcoin)" VALUE "FileVersion", VER_FILEVERSION_STR VALUE "InternalName", "bitcoin-qt" VALUE "LegalCopyright", COPYRIGHT_STR VALUE "LegalTrademarks1", "Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php." VALUE "OriginalFilename", "bitcoin-qt.exe" - VALUE "ProductName", "Bitcoin-Qt" + VALUE "ProductName", "Bitcoin Core" VALUE "ProductVersion", VER_PRODUCTVERSION_STR END END diff --git a/src/qt/splashscreen.cpp b/src/qt/splashscreen.cpp index 12280bb702..4528c3477c 100644 --- a/src/qt/splashscreen.cpp +++ b/src/qt/splashscreen.cpp @@ -23,9 +23,9 @@ SplashScreen::SplashScreen(const QPixmap &pixmap, Qt::WindowFlags f) : float fontFactor = 1.0; // define text to place - QString titleText = QString(QApplication::applicationName()).replace(QString("-testnet"), QString(""), Qt::CaseSensitive); // cut of testnet, place it as single object further down + QString titleText = tr("Bitcoin Core"); QString versionText = QString("Version %1").arg(QString::fromStdString(FormatFullVersion())); - QString copyrightText = QChar(0xA9)+QString(" 2009-%1 ").arg(COPYRIGHT_YEAR) + QString(tr("The Bitcoin developers")); + QString copyrightText = QChar(0xA9)+QString(" 2009-%1 ").arg(COPYRIGHT_YEAR) + QString(tr("The Bitcoin Core developers")); QString testnetAddText = QString(tr("[testnet]")); // define text to place as single text object QString font = "Arial"; diff --git a/src/test/serialize_tests.cpp b/src/test/serialize_tests.cpp index afcdd118bc..415f957811 100644 --- a/src/test/serialize_tests.cpp +++ b/src/test/serialize_tests.cpp @@ -61,9 +61,16 @@ BOOST_AUTO_TEST_CASE(compactsize) static bool isCanonicalException(const std::ios_base::failure& ex) { - return std::string("non-canonical ReadCompactSize()") == ex.what(); + std::ios_base::failure expectedException("non-canonical ReadCompactSize()"); + + // The string returned by what() can be different for different platforms. + // Instead of directly comparing the ex.what() with an expected string, + // create an instance of exception to see if ex.what() matches + // the expected explanatory string returned by the exception instance. + return strcmp(expectedException.what(), ex.what()) == 0; } + BOOST_AUTO_TEST_CASE(noncanonical) { // Write some non-canonical CompactSize encodings, and diff --git a/src/util.cpp b/src/util.cpp index a8c591cc7a..bedf59767b 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -242,17 +242,23 @@ int LogPrint(const char* category, const char* pszFormat, ...) if (!fDebug) return 0; - const vector<string>& categories = mapMultiArgs["-debug"]; - bool allCategories = count(categories.begin(), categories.end(), string("")); - - // Only look for categories, if not -debug/-debug=1 was passed, - // as that implies every category should be logged. - if (!allCategories) + // Give each thread quick access to -debug settings. + // This helps prevent issues debugging global destructors, + // where mapMultiArgs might be deleted before another + // global destructor calls LogPrint() + static boost::thread_specific_ptr<set<string> > ptrCategory; + if (ptrCategory.get() == NULL) { - // Category was not found (not supplied via -debug=<category>) - if (find(categories.begin(), categories.end(), string(category)) == categories.end()) - return 0; + const vector<string>& categories = mapMultiArgs["-debug"]; + ptrCategory.reset(new set<string>(categories.begin(), categories.end())); + // thread_specific_ptr automatically deletes the set when the thread ends. } + const set<string>& setCategories = *ptrCategory.get(); + + // if not debugging everything and not debugging specific category, LogPrint does nothing. + if (setCategories.count(string("")) == 0 && + setCategories.count(string(category)) == 0) + return 0; } int ret = 0; // Returns total number of characters written @@ -299,27 +305,24 @@ int LogPrint(const char* category, const char* pszFormat, ...) #ifdef WIN32 if (fPrintToDebugger) { - static CCriticalSection cs_OutputDebugStringF; - // accumulate and output a line at a time - { - LOCK(cs_OutputDebugStringF); - static std::string buffer; + static std::string buffer; - va_list arg_ptr; - va_start(arg_ptr, pszFormat); - buffer += vstrprintf(pszFormat, arg_ptr); - va_end(arg_ptr); + boost::mutex::scoped_lock scoped_lock(*mutexDebugLog); - int line_start = 0, line_end; - while((line_end = buffer.find('\n', line_start)) != -1) - { - OutputDebugStringA(buffer.substr(line_start, line_end - line_start).c_str()); - line_start = line_end + 1; - ret += line_end-line_start; - } - buffer.erase(0, line_start); + va_list arg_ptr; + va_start(arg_ptr, pszFormat); + buffer += vstrprintf(pszFormat, arg_ptr); + va_end(arg_ptr); + + int line_start = 0, line_end; + while((line_end = buffer.find('\n', line_start)) != -1) + { + OutputDebugStringA(buffer.substr(line_start, line_end - line_start).c_str()); + line_start = line_end + 1; + ret += line_end-line_start; } + buffer.erase(0, line_start); } #endif return ret; |