diff options
Diffstat (limited to 'src')
33 files changed, 2367 insertions, 330 deletions
diff --git a/src/bench/bench.cpp b/src/bench/bench.cpp index 33631d2d15..f424572913 100644 --- a/src/bench/bench.cpp +++ b/src/bench/bench.cpp @@ -100,6 +100,7 @@ bool benchmark::State::KeepRunning() int64_t averageCycles = (nowCycles-beginCycles)/count; std::cout << std::fixed << std::setprecision(15) << name << "," << count << "," << minTime << "," << maxTime << "," << average << "," << minCycles << "," << maxCycles << "," << averageCycles << "\n"; + std::cout.copyfmt(std::ios(nullptr)); return false; } diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index f3844e9d47..ff61b9065b 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -176,9 +176,7 @@ bool AppInit(int argc, char* argv[]) if (!fRet) { Interrupt(threadGroup); - // threadGroup.join_all(); was left out intentionally here, because we didn't re-test all of - // the startup-failure cases to make sure they don't result in a hang due to some - // thread-blocking-waiting-for-another-thread-during-startup case + threadGroup.join_all(); } else { WaitForShutdown(&threadGroup); } diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 02c8abb100..2021ec51db 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -162,11 +162,11 @@ public: }; chainTxData = ChainTxData{ - // Data as of block 00000000000000000166d612d5595e2b1cd88d71d695fc580af64d8da8658c23 (height 446482). - 1483472411, // * UNIX timestamp of last known number of transactions - 184495391, // * total number of transactions between genesis and that timestamp + // Data as of block 000000000000000000d97e53664d17967bd4ee50b23abb92e54a34eb222d15ae (height 478913). + 1501801925, // * UNIX timestamp of last known number of transactions + 243756039, // * total number of transactions between genesis and that timestamp // (the tx=... number in the SetBestChain debug.log lines) - 3.2 // * estimated number of transactions per second after that timestamp + 3.1 // * estimated number of transactions per second after that timestamp }; } }; @@ -250,9 +250,9 @@ public: }; chainTxData = ChainTxData{ - // Data as of block 00000000c2872f8f8a8935c8e3c5862be9038c97d4de2cf37ed496991166928a (height 1063660) - 1483546230, - 12834668, + // Data as of block 00000000000001c200b9790dc637d3bb141fe77d155b966ed775b17e109f7c6c (height 1156179) + 1501802953, + 14706531, 0.15 }; diff --git a/src/core_io.h b/src/core_io.h index 2d63be5fc4..3f25faf0ec 100644 --- a/src/core_io.h +++ b/src/core_io.h @@ -5,6 +5,8 @@ #ifndef BITCOIN_CORE_IO_H #define BITCOIN_CORE_IO_H +#include "amount.h" + #include <string> #include <vector> @@ -25,6 +27,7 @@ uint256 ParseHashStr(const std::string&, const std::string& strName); std::vector<unsigned char> ParseHexUV(const UniValue& v, const std::string& strName); // core_write.cpp +UniValue ValueFromAmount(const CAmount& amount); std::string FormatScript(const CScript& script); std::string EncodeHexTx(const CTransaction& tx, const int serializeFlags = 0); void ScriptPubKeyToUniv(const CScript& scriptPubKey, UniValue& out, bool fIncludeHex); diff --git a/src/core_write.cpp b/src/core_write.cpp index a366ef933c..217b491a0d 100644 --- a/src/core_write.cpp +++ b/src/core_write.cpp @@ -16,6 +16,16 @@ #include "utilmoneystr.h" #include "utilstrencodings.h" +UniValue ValueFromAmount(const CAmount& amount) +{ + bool sign = amount < 0; + int64_t n_abs = (sign ? -amount : amount); + int64_t quotient = n_abs / COIN; + int64_t remainder = n_abs % COIN; + return UniValue(UniValue::VNUM, + strprintf("%s%d.%08d", sign ? "-" : "", quotient, remainder)); +} + std::string FormatScript(const CScript& script) { std::string ret; @@ -184,8 +194,7 @@ void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry) UniValue out(UniValue::VOBJ); - UniValue outValue(UniValue::VNUM, FormatMoney(txout.nValue)); - out.pushKV("value", outValue); + out.pushKV("value", ValueFromAmount(txout.nValue)); out.pushKV("n", (int64_t)i); UniValue o(UniValue::VOBJ); diff --git a/src/dbwrapper.cpp b/src/dbwrapper.cpp index ba9e21cc1f..3626e0177f 100644 --- a/src/dbwrapper.cpp +++ b/src/dbwrapper.cpp @@ -115,6 +115,12 @@ CDBWrapper::CDBWrapper(const fs::path& path, size_t nCacheSize, bool fMemory, bo dbwrapper_private::HandleError(status); LogPrintf("Opened LevelDB successfully\n"); + if (GetBoolArg("-forcecompactdb", false)) { + LogPrintf("Starting database compaction of %s\n", path.string()); + pdb->CompactRange(nullptr, nullptr); + LogPrintf("Finished database compaction of %s\n", path.string()); + } + // The base-case obfuscation key, which is a noop. obfuscate_key = std::vector<unsigned char>(OBFUSCATE_KEY_NUM_BYTES, '\000'); diff --git a/src/init.cpp b/src/init.cpp index 0ee828ce92..ca62d3e7cc 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1400,9 +1400,9 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler) delete pcoinscatcher; delete pblocktree; - pblocktree = new CBlockTreeDB(nBlockTreeDBCache, false, fReindex); + pblocktree = new CBlockTreeDB(nBlockTreeDBCache, false, fReset); - if (fReindex) { + if (fReset) { pblocktree->WriteReindexing(true); //If we're reindexing in prune mode, wipe away unusable block files and all undo data files if (fPruneMode) @@ -1414,6 +1414,8 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler) // LoadBlockIndex will load fTxIndex from the db, or set it if // we're reindexing. It will also load fHavePruned if we've // ever removed a block file from disk. + // Note that it also sets fReindex based on the disk flag! + // From here on out fReindex and fReset mean something different! if (!LoadBlockIndex(chainparams)) { strLoadError = _("Error loading block database"); break; @@ -1438,8 +1440,9 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler) } // At this point blocktree args are consistent with what's on disk. - // If we're not mid-reindex (based on disk + args), add a genesis block on disk. - // This is called again in ThreadImport in the reindex completes. + // If we're not mid-reindex (based on disk + args), add a genesis block on disk + // (otherwise we use the one already on disk). + // This is called again in ThreadImport after the reindex completes. if (!fReindex && !LoadGenesisBlock(chainparams)) { strLoadError = _("Error initializing block database"); break; @@ -1448,7 +1451,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler) // At this point we're either in reindex or we've loaded a useful // block tree into mapBlockIndex! - pcoinsdbview = new CCoinsViewDB(nCoinDBCache, false, fReindex || fReindexChainState); + pcoinsdbview = new CCoinsViewDB(nCoinDBCache, false, fReset || fReindexChainState); pcoinscatcher = new CCoinsViewErrorCatcher(pcoinsdbview); // If necessary, upgrade from older database format. @@ -1467,7 +1470,8 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler) // The on-disk coinsdb is now in a good state, create the cache pcoinsTip = new CCoinsViewCache(pcoinscatcher); - if (!fReindex && !fReindexChainState) { + bool is_coinsview_empty = fReset || fReindexChainState || pcoinsTip->GetBestBlock().IsNull(); + if (!is_coinsview_empty) { // LoadChainTip sets chainActive based on pcoinsTip's best block if (!LoadChainTip(chainparams)) { strLoadError = _("Error initializing block database"); @@ -1476,7 +1480,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler) assert(chainActive.Tip() != NULL); } - if (!fReindex) { + if (!fReset) { // Note that RewindBlockIndex MUST run even if we're about to -reindex-chainstate. // It both disconnects blocks based on chainActive, and drops block data in // mapBlockIndex based on lack of available witness data. @@ -1487,7 +1491,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler) } } - if (!fReindex && !fReindexChainState) { + if (!is_coinsview_empty) { uiInterface.InitMessage(_("Verifying blocks...")); if (fHavePruned && GetArg("-checkblocks", DEFAULT_CHECKBLOCKS) > MIN_BLOCKS_TO_KEEP) { LogPrintf("Prune: pruned datadir may not have more than %d blocks; only checking available blocks", diff --git a/src/net.cpp b/src/net.cpp index d4a36a0306..ca9a173abe 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -2210,12 +2210,10 @@ CConnman::CConnman(uint64_t nSeed0In, uint64_t nSeed1In) : nSeed0(nSeed0In), nSe nReceiveFloodSize = 0; semOutbound = NULL; semAddnode = NULL; - nMaxConnections = 0; - nMaxOutbound = 0; - nMaxAddnode = 0; - nBestHeight = 0; - clientInterface = NULL; flagInterruptMsgProc = false; + + Options connOptions; + Init(connOptions); } NodeId CConnman::GetNewNodeId() @@ -2254,30 +2252,15 @@ bool CConnman::InitBinds(const std::vector<CService>& binds, const std::vector<C return fBound; } -bool CConnman::Start(CScheduler& scheduler, Options connOptions) +bool CConnman::Start(CScheduler& scheduler, const Options& connOptions) { + Init(connOptions); + nTotalBytesRecv = 0; nTotalBytesSent = 0; nMaxOutboundTotalBytesSentInCycle = 0; nMaxOutboundCycleStartTime = 0; - nRelevantServices = connOptions.nRelevantServices; - nLocalServices = connOptions.nLocalServices; - nMaxConnections = connOptions.nMaxConnections; - nMaxOutbound = std::min((connOptions.nMaxOutbound), nMaxConnections); - nMaxAddnode = connOptions.nMaxAddnode; - nMaxFeeler = connOptions.nMaxFeeler; - - nSendBufferMaxSize = connOptions.nSendBufferMaxSize; - nReceiveFloodSize = connOptions.nReceiveFloodSize; - - nMaxOutboundLimit = connOptions.nMaxOutboundLimit; - nMaxOutboundTimeframe = connOptions.nMaxOutboundTimeframe; - - SetBestHeight(connOptions.nBestHeight); - - clientInterface = connOptions.uiInterface; - if (fListen && !InitBinds(connOptions.vBinds, connOptions.vWhiteBinds)) { if (clientInterface) { clientInterface->ThreadSafeMessageBox( @@ -2287,8 +2270,6 @@ bool CConnman::Start(CScheduler& scheduler, Options connOptions) return false; } - vWhitelistedRange = connOptions.vWhitelistedRange; - for (const auto& strDest : connOptions.vSeedNodes) { AddOneShot(strDest); } @@ -146,9 +146,26 @@ public: std::vector<CSubNet> vWhitelistedRange; std::vector<CService> vBinds, vWhiteBinds; }; + + void Init(const Options& connOptions) { + nLocalServices = connOptions.nLocalServices; + nRelevantServices = connOptions.nRelevantServices; + nMaxConnections = connOptions.nMaxConnections; + nMaxOutbound = std::min(connOptions.nMaxOutbound, connOptions.nMaxConnections); + nMaxAddnode = connOptions.nMaxAddnode; + nMaxFeeler = connOptions.nMaxFeeler; + nBestHeight = connOptions.nBestHeight; + clientInterface = connOptions.uiInterface; + nSendBufferMaxSize = connOptions.nSendBufferMaxSize; + nReceiveFloodSize = connOptions.nReceiveFloodSize; + nMaxOutboundTimeframe = connOptions.nMaxOutboundTimeframe; + nMaxOutboundLimit = connOptions.nMaxOutboundLimit; + vWhitelistedRange = connOptions.vWhitelistedRange; + } + CConnman(uint64_t seed0, uint64_t seed1); ~CConnman(); - bool Start(CScheduler& scheduler, Options options); + bool Start(CScheduler& scheduler, const Options& options); void Stop(); void Interrupt(); bool GetNetworkActive() const { return fNetworkActive; }; diff --git a/src/net_processing.cpp b/src/net_processing.cpp index 4e63cd1a75..6aab13fe1c 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -1260,6 +1260,17 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr return false; } + if (nServices & ((1 << 7) | (1 << 5))) { + if (GetTime() < 1533096000) { + // Immediately disconnect peers that use service bits 6 or 8 until August 1st, 2018 + // These bits have been used as a flag to indicate that a node is running incompatible + // consensus rules instead of changing the network magic, so we're stuck disconnecting + // based on these service bits, at least for a while. + pfrom->fDisconnect = true; + return false; + } + } + if (nVersion < MIN_PEER_PROTO_VERSION) { // disconnect from peers older than this proto version diff --git a/src/qt/intro.cpp b/src/qt/intro.cpp index 1e0d472b6a..231a715753 100644 --- a/src/qt/intro.cpp +++ b/src/qt/intro.cpp @@ -22,9 +22,9 @@ static const uint64_t GB_BYTES = 1000000000LL; /* Minimum free space (in GB) needed for data directory */ -static const uint64_t BLOCK_CHAIN_SIZE = 120; +static const uint64_t BLOCK_CHAIN_SIZE = 150; /* Minimum free space (in GB) needed for data directory when pruned; Does not include prune target */ -static const uint64_t CHAIN_STATE_SIZE = 2; +static const uint64_t CHAIN_STATE_SIZE = 3; /* Total required space (in GB) depending on user choice (prune, not prune) */ static uint64_t requiredSpace; diff --git a/src/qt/locale/bitcoin_es_MX.ts b/src/qt/locale/bitcoin_es_MX.ts index bf8f0ceb88..ffa80a10bd 100644 --- a/src/qt/locale/bitcoin_es_MX.ts +++ b/src/qt/locale/bitcoin_es_MX.ts @@ -3,7 +3,7 @@ <name>AddressBookPage</name> <message> <source>Right-click to edit address or label</source> - <translation>Click derecho para editar tu dirección o etiqueta</translation> + <translation>Click derecho para editar dirección o etiqueta</translation> </message> <message> <source>Create a new address</source> @@ -31,7 +31,7 @@ </message> <message> <source>Export the data in the current tab to a file</source> - <translation>Exportar la información en la tabla actual a un archivo</translation> + <translation>Exportar la información en la pestaña actual a un archivo</translation> </message> <message> <source>&Export</source> @@ -596,6 +596,10 @@ </context> <context> <name>WalletView</name> + <message> + <source>Export the data in the current tab to a file</source> + <translation>Exportar la información en la pestaña actual a un archivo</translation> + </message> </context> <context> <name>bitcoin-core</name> diff --git a/src/qt/locale/bitcoin_fi.ts b/src/qt/locale/bitcoin_fi.ts index 38f0e1444c..d13a5639e5 100644 --- a/src/qt/locale/bitcoin_fi.ts +++ b/src/qt/locale/bitcoin_fi.ts @@ -66,6 +66,10 @@ <translation>Nämä ovat Bitcoin-osoitteesi maksujen lähettämistä varten. Tarkista aina määrä ja vastaanotto-osoite ennen kolikoiden lähettämistä.</translation> </message> <message> + <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source> + <translation>Tässä ovat Bitcoin vastaanotto-osoitteesi. On suositeltavaa käyttää uutta vastaanotto-osoitetta jokaista lähetystä varten.</translation> + </message> + <message> <source>&Copy Address</source> <translation>&Kopioi osoite</translation> </message> @@ -82,10 +86,18 @@ <translation>Vie osoitelista</translation> </message> <message> + <source>Comma separated file (*.csv)</source> + <translation>Pilkuilla erotettu tiedosto (*.csv)</translation> + </message> + <message> <source>Exporting Failed</source> <translation>Vienti epäonnistui</translation> </message> - </context> + <message> + <source>There was an error trying to save the address list to %1. Please try again.</source> + <translation>Virhe tallentaessa osoitelistaa kohteeseen %1. Yritä uudelleen.</translation> + </message> +</context> <context> <name>AddressTableModel</name> <message> @@ -120,14 +132,26 @@ <translation>Toista uusi tunnuslause</translation> </message> <message> + <source>Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>ten or more random characters</b>, or <b>eight or more words</b>.</source> + <translation>Kirjoita uusi salauslause lompakolle.<br/>Käytä salauslausetta jossa on joko<b>kymmenen tai useampi satunnainen merkki</b>, tai<b>vähintään kahdeksan sanaa</b></translation> + </message> + <message> <source>Encrypt wallet</source> <translation>Salaa lompakko</translation> </message> <message> + <source>This operation needs your wallet passphrase to unlock the wallet.</source> + <translation>Tämä toiminto vaatii lompakkosi tunnuslauseen sen avaamiseksi</translation> + </message> + <message> <source>Unlock wallet</source> <translation>Avaa lompakko</translation> </message> <message> + <source>This operation needs your wallet passphrase to decrypt the wallet.</source> + <translation>Tämä toiminto vaatii lompakkosia tunnuslauseen salauksen purkuun</translation> + </message> + <message> <source>Decrypt wallet</source> <translation>Pura lompakon salaus</translation> </message> @@ -136,10 +160,18 @@ <translation>Vaihda salasana</translation> </message> <message> + <source>Enter the old passphrase and new passphrase to the wallet.</source> + <translation>Syötä vanha ja uusi tunnuslause lompakolle.</translation> + </message> + <message> <source>Confirm wallet encryption</source> <translation>Vahvista lompakon salaaminen</translation> </message> <message> + <source>Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>!</source> + <translation>Varoitus: Jos salaat lompakkosi ja menetät tunnuslauseesi, <b>MENETÄT KAIKKI BITCOINISI</b>!</translation> + </message> + <message> <source>Are you sure you wish to encrypt your wallet?</source> <translation>Oletko varma, että haluat salata lompakkosi?</translation> </message> @@ -148,14 +180,34 @@ <translation>Lompakko salattiin</translation> </message> <message> + <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source> + <translation>%1 sulkeutuu lopettaakseen salausprosessin. Muista, että salattukaan lompakko ei täysin suojaa sitä haittaohjelmien aiheuttamilta varkauksilta.</translation> + </message> + <message> + <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source> + <translation>TÄRKEÄÄ: Kaikki tekemäsi vanhan lompakon varmuuskopiot pitäisi korvata uusilla suojatuilla varmuuskopioilla. Turvallisuussyistä edelliset varmuuskopiot muuttuvat turhiksi, kun aloitat uuden suojatun lompakon käytön.</translation> + </message> + <message> <source>Wallet encryption failed</source> <translation>Lompakon salaus epäonnistui</translation> </message> <message> + <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> + <translation>Lompakon salaaminen epäonnistui sisäisen virheen vuoksi. Lompakkoasi ei salattu.</translation> + </message> + <message> + <source>The supplied passphrases do not match.</source> + <translation>Annetut salauslauseet eivät täsmää.</translation> + </message> + <message> <source>Wallet unlock failed</source> <translation>Lompakon lukituksen avaaminen epäonnistui</translation> </message> <message> + <source>The passphrase entered for the wallet decryption was incorrect.</source> + <translation>Annettu salauslause lompakon avaamiseksi oli väärä.</translation> + </message> + <message> <source>Wallet decryption failed</source> <translation>Lompakon salauksen purkaminen epäonnistui</translation> </message> @@ -278,6 +330,10 @@ <translation>Paina ottaaksesi verkkoyhteysilmaisin uudelleen käyttöön.</translation> </message> <message> + <source>Syncing Headers (%1%)...</source> + <translation>Synkronoidaan Tunnisteita (%1%)...</translation> + </message> + <message> <source>Reindexing blocks on disk...</source> <translation>Ladataan lohkoindeksiä...</translation> </message> @@ -476,6 +532,14 @@ <translation>Saapuva rahansiirto</translation> </message> <message> + <source>HD key generation is <b>enabled</b></source> + <translation>HD avaimen generointi on <b>päällä</b></translation> + </message> + <message> + <source>HD key generation is <b>disabled</b></source> + <translation>HD avaimen generointi on </b>pois päältä</b></translation> + </message> + <message> <source>Wallet is <b>encrypted</b> and currently <b>unlocked</b></source> <translation>Lompakko on <b>salattu</b> ja tällä hetkellä <b>avoinna</b></translation> </message> @@ -483,7 +547,11 @@ <source>Wallet is <b>encrypted</b> and currently <b>locked</b></source> <translation>Lompakko on <b>salattu</b> ja tällä hetkellä <b>lukittuna</b></translation> </message> - </context> + <message> + <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source> + <translation>Peruuttamaton virhe on tapahtunut. Bitcoin ei voi enää jatkaa turvallisesti ja sammutetaan.</translation> + </message> +</context> <context> <name>CoinControlDialog</name> <message> @@ -615,6 +683,10 @@ <translation>ei</translation> </message> <message> + <source>Can vary +/- %1 satoshi(s) per input.</source> + <translation>Saattaa vaihdella +/- %1 satoshia per syöte.</translation> + </message> + <message> <source>(no label)</source> <translation>(ei nimikettä)</translation> </message> @@ -654,6 +726,26 @@ <translation>Uusi lähetysosoite</translation> </message> <message> + <source>Edit receiving address</source> + <translation>Muokkaa vastaanottavaa osoitetta</translation> + </message> + <message> + <source>Edit sending address</source> + <translation>Muokkaa lähettävää osoitetta</translation> + </message> + <message> + <source>The entered address "%1" is not a valid Bitcoin address.</source> + <translation>Antamasi osoite "%1" ei ole kelvollinen Bitcoin-osoite.</translation> + </message> + <message> + <source>The entered address "%1" is already in the address book.</source> + <translation>Antamasi osoite "%1" on jo osoitekirjassa</translation> + </message> + <message> + <source>Could not unlock wallet.</source> + <translation>Lompakkoa ei voitu avata.</translation> + </message> + <message> <source>New key generation failed.</source> <translation>Uuden avaimen luonti epäonnistui.</translation> </message> @@ -1206,10 +1298,22 @@ <context> <name>QRImageWidget</name> <message> + <source>&Save Image...</source> + <translation>&Tallenna kuva</translation> + </message> + <message> + <source>&Copy Image</source> + <translation>&Kopioi kuva</translation> + </message> + <message> <source>Save QR Code</source> <translation>Tallenna QR-koodi</translation> </message> - </context> + <message> + <source>PNG Image (*.png)</source> + <translation>PNG kuva (*.png)</translation> + </message> +</context> <context> <name>RPCConsole</name> <message> @@ -1568,6 +1672,10 @@ <translation>Kopioi nimike</translation> </message> <message> + <source>Copy message</source> + <translation>Kopioi viesti</translation> + </message> + <message> <source>Copy amount</source> <translation>Kopioi määrä</translation> </message> @@ -1591,6 +1699,10 @@ <translation>&Tallenna kuva</translation> </message> <message> + <source>Payment information</source> + <translation>Maksutiedot</translation> + </message> + <message> <source>Address</source> <translation>Osoite</translation> </message> @@ -1793,6 +1905,10 @@ <translation>Kopioi vaihtorahat</translation> </message> <message> + <source>Total Amount %1</source> + <translation>Kokonaismäärä %1</translation> + </message> + <message> <source>or</source> <translation>tai</translation> </message> @@ -1882,7 +1998,11 @@ </context> <context> <name>SendConfirmationDialog</name> - </context> + <message> + <source>Yes</source> + <translation>Kyllä</translation> + </message> +</context> <context> <name>ShutdownWindow</name> <message> @@ -1972,7 +2092,11 @@ <source>Reset all verify message fields</source> <translation>Tyhjennä kaikki varmista-viesti-kentät</translation> </message> - </context> + <message> + <source>Message verified.</source> + <translation>Viesti varmistettu.</translation> + </message> +</context> <context> <name>SplashScreen</name> <message> @@ -1990,14 +2114,50 @@ <context> <name>TransactionDesc</name> <message> + <source>%1/unconfirmed</source> + <translation>%1/vahvistamaton</translation> + </message> + <message> + <source>%1 confirmations</source> + <translation>%1 vahvistusta</translation> + </message> + <message> <source>Date</source> <translation>Aika</translation> </message> <message> + <source>Source</source> + <translation>Lähde</translation> + </message> + <message> + <source>Generated</source> + <translation>Generoitu</translation> + </message> + <message> + <source>From</source> + <translation>Lähettäjä</translation> + </message> + <message> + <source>unknown</source> + <translation>tuntematon</translation> + </message> + <message> + <source>To</source> + <translation>Saaja</translation> + </message> + <message> + <source>own address</source> + <translation>oma osoite</translation> + </message> + <message> <source>Message</source> <translation>Viesti</translation> </message> <message> + <source>Comment</source> + <translation>Kommentti</translation> + </message> + <message> <source>Amount</source> <translation>Määrä</translation> </message> @@ -2016,10 +2176,30 @@ <translation>Aika</translation> </message> <message> + <source>Type</source> + <translation>Tyyppi</translation> + </message> + <message> <source>Label</source> <translation>Nimike</translation> </message> <message> + <source>Received with</source> + <translation>Vastaanotettu osoitteella</translation> + </message> + <message> + <source>Sent to</source> + <translation>Lähetetty vastaanottajalle</translation> + </message> + <message> + <source>Payment to yourself</source> + <translation>Maksu itsellesi</translation> + </message> + <message> + <source>Mined</source> + <translation>Louhittu</translation> + </message> + <message> <source>(no label)</source> <translation>(ei nimikettä)</translation> </message> @@ -2027,6 +2207,50 @@ <context> <name>TransactionView</name> <message> + <source>All</source> + <translation>Kaikki</translation> + </message> + <message> + <source>Today</source> + <translation>Tänään</translation> + </message> + <message> + <source>This week</source> + <translation>Tällä viikolla</translation> + </message> + <message> + <source>This month</source> + <translation>Tässä kuussa</translation> + </message> + <message> + <source>Last month</source> + <translation>Viime kuussa</translation> + </message> + <message> + <source>This year</source> + <translation>Tänä vuonna</translation> + </message> + <message> + <source>Received with</source> + <translation>Vastaanotettu osoitteella</translation> + </message> + <message> + <source>Sent to</source> + <translation>Lähetetty vastaanottajalle</translation> + </message> + <message> + <source>To yourself</source> + <translation>Itsellesi</translation> + </message> + <message> + <source>Mined</source> + <translation>Louhittu</translation> + </message> + <message> + <source>Min amount</source> + <translation>Minimimäärä</translation> + </message> + <message> <source>Copy address</source> <translation>Kopioi osoite</translation> </message> @@ -2043,10 +2267,34 @@ <translation>Kopioi transaktion ID</translation> </message> <message> + <source>Edit label</source> + <translation>Muokkaa nimeä</translation> + </message> + <message> + <source>Show transaction details</source> + <translation>Näytä rahansiirron yksityiskohdat</translation> + </message> + <message> + <source>Export Transaction History</source> + <translation>Vie rahansiirtohistoria</translation> + </message> + <message> + <source>Comma separated file (*.csv)</source> + <translation>Pilkuilla erotettu tiedosto (*.csv)</translation> + </message> + <message> + <source>Confirmed</source> + <translation>Vahvistettu</translation> + </message> + <message> <source>Date</source> <translation>Aika</translation> </message> <message> + <source>Type</source> + <translation>Tyyppi</translation> + </message> + <message> <source>Label</source> <translation>Nimike</translation> </message> @@ -2055,10 +2303,26 @@ <translation>Osoite</translation> </message> <message> + <source>ID</source> + <translation>ID</translation> + </message> + <message> <source>Exporting Failed</source> <translation>Vienti epäonnistui</translation> </message> - </context> + <message> + <source>There was an error trying to save the transaction history to %1.</source> + <translation>Rahansiirron historian tallentamisessa tapahtui virhe paikkaan %1.</translation> + </message> + <message> + <source>Exporting Successful</source> + <translation>Vienti onnistui</translation> + </message> + <message> + <source>to</source> + <translation>vastaanottaja</translation> + </message> +</context> <context> <name>UnitDisplayStatusBarControl</name> <message> @@ -2068,16 +2332,44 @@ </context> <context> <name>WalletFrame</name> - </context> + <message> + <source>No wallet has been loaded.</source> + <translation>Lomakkoa ei ole ladattu.</translation> + </message> +</context> <context> <name>WalletModel</name> - </context> + <message> + <source>Send Coins</source> + <translation>Lähetä kolikoita</translation> + </message> +</context> <context> <name>WalletView</name> <message> <source>&Export</source> <translation>&Vie</translation> </message> + <message> + <source>Export the data in the current tab to a file</source> + <translation>Vie auki olevan välilehden tiedot tiedostoon</translation> + </message> + <message> + <source>Backup Wallet</source> + <translation>Varmuuskopioi lompakko</translation> + </message> + <message> + <source>Wallet Data (*.dat)</source> + <translation>Lompakkodata (*.dat)</translation> + </message> + <message> + <source>Backup Failed</source> + <translation>Varmuuskopio epäonnistui</translation> + </message> + <message> + <source>Backup Successful</source> + <translation>Varmuuskopio Onnistui</translation> + </message> </context> <context> <name>bitcoin-core</name> @@ -2318,6 +2610,10 @@ <translation>Karsittu tila ei ole yhteensopiva -txindex:n kanssa.</translation> </message> <message> + <source>Rewinding blocks...</source> + <translation>Varmistetaan lohkoja...</translation> + </message> + <message> <source>Set database cache size in megabytes (%d to %d, default: %d)</source> <translation>Aseta tietokannan välimuistin koko megatavuissa (%d - %d, oletus: %d</translation> </message> @@ -2554,6 +2850,10 @@ <translation>Käytä erillistä SOCKS5-proxyä tavoittaaksesi vertaisia Tor-piilopalveluiden kautta (oletus: %s)</translation> </message> <message> + <source>%s is set very high!</source> + <translation>%s on asetettu todella korkeaksi!</translation> + </message> + <message> <source>(default: %s)</source> <translation>(oletus: %s)</translation> </message> @@ -2638,10 +2938,26 @@ <translation>Käytä vahvistamattomia vaihtorahoja lähetettäessä rahansiirtoja (oletus: %u)</translation> </message> <message> + <source>Starting network threads...</source> + <translation>Käynnistetään verkkoa...</translation> + </message> + <message> + <source>This is the transaction fee you will pay if you send a transaction.</source> + <translation>Tämä on lähetyksestä maksettava maksu jonka maksat</translation> + </message> + <message> <source>Threshold for disconnecting misbehaving peers (default: %u)</source> <translation>Aikaväli sopimattomien vertaisten yhteyksien katkaisuun (oletus: %u)</translation> </message> <message> + <source>Transaction amounts must not be negative</source> + <translation>Lähetyksen siirtosumman tulee olla positiivinen</translation> + </message> + <message> + <source>Transaction must have at least one recipient</source> + <translation>Lähetyksessä tulee olla ainakin yksi vastaanottaja</translation> + </message> + <message> <source>Unknown network specified in -onlynet: '%s'</source> <translation>Tuntematon verkko -onlynet parametrina: '%s'</translation> </message> diff --git a/src/qt/locale/bitcoin_ka.ts b/src/qt/locale/bitcoin_ka.ts index 5aa9137753..c51a611b3c 100644 --- a/src/qt/locale/bitcoin_ka.ts +++ b/src/qt/locale/bitcoin_ka.ts @@ -2,6 +2,10 @@ <context> <name>AddressBookPage</name> <message> + <source>Right-click to edit address or label</source> + <translation>დააჭირეთ მარჯვენა ღილაკს მისამართის ან იარლიყის ჩასასწორებლად</translation> + </message> + <message> <source>Create a new address</source> <translation>ახალი მისამართის შექმნა</translation> </message> @@ -38,6 +42,10 @@ <translation>&წაშლა</translation> </message> <message> + <source>C&hoose</source> + <translation>&არჩევა</translation> + </message> + <message> <source>Sending addresses</source> <translation>გამმგზავნი მისამართ</translation> </message> @@ -45,9 +53,17 @@ <source>Receiving addresses</source> <translation>მიმღები მისამართი</translation> </message> + <message> + <source>&Edit</source> + <translation>&რედაქტირება</translation> + </message> </context> <context> <name>AddressTableModel</name> + <message> + <source>Address</source> + <translation>მისამართი</translation> + </message> </context> <context> <name>AskPassphraseDialog</name> @@ -67,6 +83,22 @@ <source>Repeat new passphrase</source> <translation>გაიმეორეთ ახალი ფრაზა-პაროლი</translation> </message> + <message> + <source>Encrypt wallet</source> + <translation>საფულის დაშიფრვა</translation> + </message> + <message> + <source>Unlock wallet</source> + <translation>საფულის განბლოკვა</translation> + </message> + <message> + <source>Decrypt wallet</source> + <translation>საფულის განბლოკვა</translation> + </message> + <message> + <source>Change passphrase</source> + <translation>პაროლის შეცვლა</translation> + </message> </context> <context> <name>BanTableModel</name> @@ -110,6 +142,14 @@ <translation>გასვლა</translation> </message> <message> + <source>&About %1</source> + <translation>%1-ის &შესახებ</translation> + </message> + <message> + <source>Show information about %1</source> + <translation>%1-ის შესახებ ინფორმაციის ჩვენება</translation> + </message> + <message> <source>About &Qt</source> <translation>&Qt-ს შესახებ</translation> </message> @@ -274,8 +314,36 @@ <translation>განახლებულია</translation> </message> <message> + <source>%1 client</source> + <translation>%1 კლიენტი</translation> + </message> + <message> <source>Catching up...</source> - <translation>ჩართვა...</translation> + <translation>მიმდინარეობს განახლება...</translation> + </message> + <message> + <source>Date: %1 +</source> + <translation>თარიღი: %1 +</translation> + </message> + <message> + <source>Amount: %1 +</source> + <translation>რაოდენობა: %1 +</translation> + </message> + <message> + <source>Type: %1 +</source> + <translation>ტიპი: %1 +</translation> + </message> + <message> + <source>Address: %1 +</source> + <translation>მისამართი: %1 +</translation> </message> <message> <source>Sent transaction</source> @@ -313,6 +381,10 @@ <translation>საკომისიო:</translation> </message> <message> + <source>Dust:</source> + <translation>მტვერი:</translation> + </message> + <message> <source>After Fee:</source> <translation>დამატებითი საკომისიო:</translation> </message> @@ -348,7 +420,19 @@ <source>Confirmed</source> <translation>დადასტურებულია</translation> </message> - </context> + <message> + <source>yes</source> + <translation>დიახ</translation> + </message> + <message> + <source>no</source> + <translation>არა</translation> + </message> + <message> + <source>(change)</source> + <translation>(ხურდა)</translation> + </message> +</context> <context> <name>EditAddressDialog</name> <message> @@ -402,6 +486,14 @@ <translation>ვერსია</translation> </message> <message> + <source>(%1-bit)</source> + <translation>(%1-ბიტი)</translation> + </message> + <message> + <source>About %1</source> + <translation>%1-ის შესახებ</translation> + </message> + <message> <source>Command-line options</source> <translation>კომანდების ზოლის ოპციები</translation> </message> @@ -413,6 +505,10 @@ <source>command-line options</source> <translation>კომანდების ზოლის ოპციები</translation> </message> + <message> + <source>UI Options:</source> + <translation>მომხმარებლის ინტერფეისის ოპციები:</translation> + </message> </context> <context> <name>Intro</name> @@ -421,6 +517,10 @@ <translation>მოგესალმებით</translation> </message> <message> + <source>Welcome to %1.</source> + <translation>კეთილი იყოს თქვენი მობრძანება %1-ში.</translation> + </message> + <message> <source>Use the default data directory</source> <translation>ნაგულისხმევი კატალოგის გამოყენება</translation> </message> @@ -432,7 +532,15 @@ <source>Error</source> <translation>შეცდომა</translation> </message> - </context> + <message numerus="yes"> + <source>%n GB of free space available</source> + <translation><numerusform>ხელმისაწვდომია თავისუფალი სივრცის %n გბ</numerusform></translation> + </message> + <message numerus="yes"> + <source>(of %n GB needed)</source> + <translation><numerusform>(საჭირო %n გბ-დან)</numerusform></translation> + </message> +</context> <context> <name>ModalOverlay</name> <message> @@ -440,9 +548,25 @@ <translation>ფორმა</translation> </message> <message> + <source>Unknown...</source> + <translation>უცნობი...</translation> + </message> + <message> <source>Last block time</source> <translation>ბოლო ბლოკის დრო</translation> </message> + <message> + <source>Progress</source> + <translation>პროგრესი</translation> + </message> + <message> + <source>calculating...</source> + <translation>მიმდინარეობს გამოთვლა...</translation> + </message> + <message> + <source>Hide</source> + <translation>დამალვა</translation> + </message> </context> <context> <name>OpenURIDialog</name> @@ -510,6 +634,10 @@ <translation>ს&აფულე</translation> </message> <message> + <source>Expert</source> + <translation>ექსპერტი</translation> + </message> + <message> <source>If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.</source> <translation>დაუდასტურებელი ხურდის გამოყენების აკრძალვის შემდეგ მათი გამოყენება შეუძლებელი იქნება, სანამ ტრანსაქციას არ ექნება ერთი დასტური მაინც. ეს აისახება თქვენი ნაშთის დათვლაზეც.</translation> </message> @@ -534,6 +662,18 @@ <translation>პროქსის პორტი (მაგ.: 9050)</translation> </message> <message> + <source>IPv4</source> + <translation>IPv4</translation> + </message> + <message> + <source>IPv6</source> + <translation>IPv6</translation> + </message> + <message> + <source>Tor</source> + <translation>Tor</translation> + </message> + <message> <source>&Window</source> <translation>&ფანჯარა</translation> </message> @@ -880,6 +1020,10 @@ <source>&Save Image...</source> <translation>გამო&სახულების შენახვა...</translation> </message> + <message> + <source>Address</source> + <translation>მისამართი</translation> + </message> </context> <context> <name>RecentRequestsTableModel</name> @@ -943,6 +1087,10 @@ <translation>ტრანსაქციის საფასური - საკომისიო:</translation> </message> <message> + <source>Hide</source> + <translation>დამალვა</translation> + </message> + <message> <source>Send to multiple recipients at once</source> <translation>გაგზავნა რამდენიმე რეციპიენტთან ერთდროულად</translation> </message> @@ -955,6 +1103,10 @@ <translation>ფორმის ყველა ველის წაშლა</translation> </message> <message> + <source>Dust:</source> + <translation>მტვერი:</translation> + </message> + <message> <source>Clear &All</source> <translation>გ&ასუფთავება</translation> </message> @@ -1140,6 +1292,10 @@ </context> <context> <name>TransactionView</name> + <message> + <source>Address</source> + <translation>მისამართი</translation> + </message> </context> <context> <name>UnitDisplayStatusBarControl</name> diff --git a/src/qt/locale/bitcoin_ru_RU.ts b/src/qt/locale/bitcoin_ru_RU.ts index 66ab7c81f4..0cb0e7f6e4 100644 --- a/src/qt/locale/bitcoin_ru_RU.ts +++ b/src/qt/locale/bitcoin_ru_RU.ts @@ -49,16 +49,104 @@ <source>Choose the address to receive coins with</source> <translation>Выбрать адрес для получения монет</translation> </message> + <message> + <source>C&hoose</source> + <translation>В&ыбрать</translation> + </message> + <message> + <source>Sending addresses</source> + <translation>Адреса отправки</translation> + </message> + <message> + <source>Receiving addresses</source> + <translation>Адреса получения</translation> + </message> + <message> + <source>&Copy Address</source> + <translation>&Копировать адрес</translation> + </message> + <message> + <source>Copy &Label</source> + <translation>Копировать &метку</translation> + </message> + <message> + <source>&Edit</source> + <translation>&Редактировать</translation> + </message> + <message> + <source>Export Address List</source> + <translation>Экспортировать список адресов</translation> + </message> + <message> + <source>Exporting Failed</source> + <translation>Экспорт не удался</translation> + </message> </context> <context> <name>AddressTableModel</name> - </context> + <message> + <source>Label</source> + <translation>Метка</translation> + </message> + <message> + <source>Address</source> + <translation>Адрес</translation> + </message> + <message> + <source>(no label)</source> + <translation>(нет метки)</translation> + </message> +</context> <context> <name>AskPassphraseDialog</name> <message> + <source>Passphrase Dialog</source> + <translation>Ввод пароля</translation> + </message> + <message> + <source>Enter passphrase</source> + <translation>Введите пароль</translation> + </message> + <message> + <source>New passphrase</source> + <translation>Новый пароль</translation> + </message> + <message> <source>Repeat new passphrase</source> <translation>Повторите новый пароль</translation> </message> + <message> + <source>Encrypt wallet</source> + <translation>Зашифровать бумажник</translation> + </message> + <message> + <source>This operation needs your wallet passphrase to unlock the wallet.</source> + <translation>Эта операция требует вашего пароля для разблокировки бумажника</translation> + </message> + <message> + <source>Unlock wallet</source> + <translation>Разблокировать бумажник</translation> + </message> + <message> + <source>Decrypt wallet</source> + <translation>Расшифровать бумажник</translation> + </message> + <message> + <source>Change passphrase</source> + <translation>Изменить пароль</translation> + </message> + <message> + <source>Confirm wallet encryption</source> + <translation>Подтвердите шифрование бумажника</translation> + </message> + <message> + <source>Wallet encrypted</source> + <translation>Бумажник зашифрован</translation> + </message> + <message> + <source>Wallet unlock failed</source> + <translation>Ошибка разблокировки кошелька</translation> + </message> </context> <context> <name>BanTableModel</name> @@ -66,10 +154,114 @@ <context> <name>BitcoinGUI</name> <message> + <source>Sign &message...</source> + <translation>Подписать &сообщение...</translation> + </message> + <message> + <source>&Transactions</source> + <translation>&Транзакции</translation> + </message> + <message> + <source>Browse transaction history</source> + <translation>Просмотр истории транзакций</translation> + </message> + <message> + <source>E&xit</source> + <translation>В&ыход</translation> + </message> + <message> + <source>Quit application</source> + <translation>Выйти</translation> + </message> + <message> + <source>&About %1</source> + <translation>&О программе %1</translation> + </message> + <message> + <source>Show information about %1</source> + <translation>Показать информацию о %1</translation> + </message> + <message> + <source>About &Qt</source> + <translation>О библиотеке &Qt</translation> + </message> + <message> + <source>Show information about Qt</source> + <translation>Показать информацию о библиотеке Qt</translation> + </message> + <message> + <source>&Options...</source> + <translation>&Опции...</translation> + </message> + <message> + <source>&Encrypt Wallet...</source> + <translation>&Зашифровать кошелёк</translation> + </message> + <message> + <source>&Backup Wallet...</source> + <translation>&Создать резервную копию бумажника</translation> + </message> + <message> + <source>&Change Passphrase...</source> + <translation>&Изменить пароль...</translation> + </message> + <message> + <source>&Sending addresses...</source> + <translation>&Адреса для отправки...</translation> + </message> + <message> + <source>&Receiving addresses...</source> + <translation>&Адреса для получения...</translation> + </message> + <message> + <source>Open &URI...</source> + <translation>Открыть &URI...</translation> + </message> + <message> + <source>Syncing Headers (%1%)...</source> + <translation>Синхронизация заголовков (%1%)...</translation> + </message> + <message> + <source>&Debug window</source> + <translation>&Окно отладки</translation> + </message> + <message> + <source>&Verify message...</source> + <translation>&Проверить сообщение...</translation> + </message> + <message> <source>Bitcoin</source> <translation>Bitcoin Core</translation> </message> <message> + <source>Wallet</source> + <translation>Кошелек</translation> + </message> + <message> + <source>&Send</source> + <translation>&Отправить</translation> + </message> + <message> + <source>&Receive</source> + <translation>&Получить</translation> + </message> + <message> + <source>&Show / Hide</source> + <translation>&Показать / Спрятать</translation> + </message> + <message> + <source>&File</source> + <translation>&Файл</translation> + </message> + <message> + <source>&Settings</source> + <translation>&Настройки</translation> + </message> + <message> + <source>&Help</source> + <translation>&Помощь</translation> + </message> + <message> <source>&Command-line options</source> <translation>Опции командной строки</translation> </message> @@ -85,10 +277,30 @@ <source>Information</source> <translation>Информация</translation> </message> + <message> + <source>Up to date</source> + <translation>Готов</translation> + </message> + <message> + <source>Connecting to peers...</source> + <translation>Подключение к пирам...</translation> + </message> </context> <context> <name>CoinControlDialog</name> <message> + <source>Bytes:</source> + <translation>Байтов:</translation> + </message> + <message> + <source>Amount:</source> + <translation>Количество:</translation> + </message> + <message> + <source>Fee:</source> + <translation>Комиссия:</translation> + </message> + <message> <source>Date</source> <translation>Дата</translation> </message> @@ -100,6 +312,34 @@ <source>Confirmed</source> <translation>Подтвержденные</translation> </message> + <message> + <source>Copy address</source> + <translation>Копировать адрес</translation> + </message> + <message> + <source>Copy label</source> + <translation>Копировать метку</translation> + </message> + <message> + <source>Copy amount</source> + <translation>Копировать сумму</translation> + </message> + <message> + <source>Copy transaction ID</source> + <translation>Копировать ID транзакции</translation> + </message> + <message> + <source>yes</source> + <translation>да</translation> + </message> + <message> + <source>no</source> + <translation>нет</translation> + </message> + <message> + <source>(no label)</source> + <translation>(нет метки)</translation> + </message> </context> <context> <name>EditAddressDialog</name> @@ -125,16 +365,36 @@ <source>command-line options</source> <translation>Опции командной строки</translation> </message> + <message> + <source>Start minimized</source> + <translation>Запускать свернутым</translation> + </message> </context> <context> <name>Intro</name> <message> + <source>Welcome</source> + <translation>Добро пожаловать</translation> + </message> + <message> + <source>Welcome to %1.</source> + <translation>Добро пожаловать в %1.</translation> + </message> + <message> <source>Error</source> <translation>Ошибка</translation> </message> </context> <context> <name>ModalOverlay</name> + <message> + <source>Progress</source> + <translation>Прогресс</translation> + </message> + <message> + <source>Hide</source> + <translation>Спрятать</translation> + </message> </context> <context> <name>OpenURIDialog</name> @@ -149,9 +409,109 @@ </context> <context> <name>OptionsDialog</name> + <message> + <source>Options</source> + <translation>Опции</translation> + </message> + <message> + <source>MB</source> + <translation>МБ</translation> + </message> + <message> + <source>Allow incoming connections</source> + <translation>Разрешить входящие соеденения</translation> + </message> + <message> + <source>&Reset Options</source> + <translation>&Сбросить опции</translation> + </message> + <message> + <source>&Network</source> + <translation>&Сеть</translation> + </message> + <message> + <source>W&allet</source> + <translation>К&ошелёк</translation> + </message> + <message> + <source>Expert</source> + <translation>Эксперт</translation> + </message> + <message> + <source>Map port using &UPnP</source> + <translation>Пробросить порт через &UPnP</translation> + </message> + <message> + <source>Connect to the Bitcoin network through a SOCKS5 proxy.</source> + <translation>Подключится к сети Bitcoin через SOCKS5 прокси.</translation> + </message> + <message> + <source>Proxy &IP:</source> + <translation>IP прокси:</translation> + </message> + <message> + <source>&Port:</source> + <translation>&Порт:</translation> + </message> + <message> + <source>Port of the proxy (e.g. 9050)</source> + <translation>Порт прокси: (напр. 9050)</translation> + </message> + <message> + <source>IPv4</source> + <translation>IPv4</translation> + </message> + <message> + <source>IPv6</source> + <translation>IPv6</translation> + </message> + <message> + <source>Tor</source> + <translation>Tor</translation> + </message> + <message> + <source>&Window</source> + <translation>&Окно</translation> + </message> + <message> + <source>Hide tray icon</source> + <translation>Спрятать иконку в трее</translation> + </message> + <message> + <source>&OK</source> + <translation>&ОК</translation> + </message> + <message> + <source>&Cancel</source> + <translation>&Отмена</translation> + </message> </context> <context> <name>OverviewPage</name> + <message> + <source>Immature:</source> + <translation>Незрелые:</translation> + </message> + <message> + <source>Balances</source> + <translation>Балансы</translation> + </message> + <message> + <source>Total:</source> + <translation>Всего:</translation> + </message> + <message> + <source>Your current total balance</source> + <translation>Ваш текущий баланс:</translation> + </message> + <message> + <source>Your current balance in watch-only addresses</source> + <translation>Ваш текущий баланс на адресах только для чтения:</translation> + </message> + <message> + <source>Recent transactions</source> + <translation>Последние транзакции</translation> + </message> </context> <context> <name>PaymentServer</name> @@ -161,43 +521,243 @@ </context> <context> <name>QObject</name> + <message> + <source>Enter a Bitcoin address (e.g. %1)</source> + <translation>Введите биткоин-адрес (напр. %1)</translation> + </message> + <message numerus="yes"> + <source>%n hour(s)</source> + <translation><numerusform>%n час</numerusform><numerusform>%n часа</numerusform><numerusform>%n часов</numerusform><numerusform>%n часов</numerusform></translation> + </message> + <message numerus="yes"> + <source>%n day(s)</source> + <translation><numerusform>%n день</numerusform><numerusform>%n дней</numerusform><numerusform>%n дней</numerusform><numerusform>%n дней</numerusform></translation> + </message> + <message numerus="yes"> + <source>%n week(s)</source> + <translation><numerusform>%n неделя</numerusform><numerusform>%n недель</numerusform><numerusform>%n недель</numerusform><numerusform>%n недель</numerusform></translation> + </message> + <message> + <source>%1 and %2</source> + <translation>%1 и %2</translation> + </message> + <message numerus="yes"> + <source>%n year(s)</source> + <translation><numerusform>%n год</numerusform><numerusform>%n лет</numerusform><numerusform>%n лет</numerusform><numerusform>%n лет</numerusform></translation> + </message> </context> <context> <name>QObject::QObject</name> - </context> + <message> + <source>Error: %1</source> + <translation>Ошибка: %1</translation> + </message> +</context> <context> <name>QRImageWidget</name> - </context> + <message> + <source>Save QR Code</source> + <translation>Сохранить QR-код</translation> + </message> + <message> + <source>PNG Image (*.png)</source> + <translation>PNG Картинка (*.png)</translation> + </message> +</context> <context> <name>RPCConsole</name> <message> <source>&Information</source> <translation>Информация</translation> </message> - </context> + <message> + <source>Debug window</source> + <translation>Окно отладки</translation> + </message> + <message> + <source>Received</source> + <translation>Получено</translation> + </message> + <message> + <source>Sent</source> + <translation>Отправлено</translation> + </message> + <message> + <source>&Peers</source> + <translation>&Пиры</translation> + </message> + <message> + <source>Banned peers</source> + <translation>Заблокированные пиры</translation> + </message> + <message> + <source>Version</source> + <translation>Версия</translation> + </message> + <message> + <source>&Open</source> + <translation>&Открыть</translation> + </message> + <message> + <source>&Console</source> + <translation>&Консоль</translation> + </message> + <message> + <source>1 &hour</source> + <translation>1 &час</translation> + </message> + <message> + <source>1 &day</source> + <translation>1 &день</translation> + </message> + <message> + <source>1 &week</source> + <translation>1 &неделя</translation> + </message> + <message> + <source>1 &year</source> + <translation>1 &год</translation> + </message> + <message> + <source>%1 B</source> + <translation>%1 Б</translation> + </message> + <message> + <source>%1 KB</source> + <translation>%1 КБ</translation> + </message> + <message> + <source>%1 MB</source> + <translation>%1 МБ</translation> + </message> + <message> + <source>%1 GB</source> + <translation>%1 ГБ</translation> + </message> + <message> + <source>never</source> + <translation>никогда</translation> + </message> + <message> + <source>Yes</source> + <translation>Да</translation> + </message> + <message> + <source>No</source> + <translation>Нет</translation> + </message> + <message> + <source>Unknown</source> + <translation>Неизвестно</translation> + </message> +</context> <context> <name>ReceiveCoinsDialog</name> - </context> + <message> + <source>Clear</source> + <translation>Отчистить</translation> + </message> + <message> + <source>Show</source> + <translation>Показать</translation> + </message> + <message> + <source>Remove</source> + <translation>Удалить</translation> + </message> + <message> + <source>Copy URI</source> + <translation>Копировать URI</translation> + </message> + <message> + <source>Copy label</source> + <translation>Копировать метку</translation> + </message> + <message> + <source>Copy message</source> + <translation>Копировать сообщение</translation> + </message> + <message> + <source>Copy amount</source> + <translation>Копировать сумму</translation> + </message> +</context> <context> <name>ReceiveRequestDialog</name> + <message> + <source>Address</source> + <translation>Адрес</translation> + </message> + <message> + <source>Label</source> + <translation>Метка</translation> + </message> </context> <context> <name>RecentRequestsTableModel</name> + <message> + <source>Label</source> + <translation>Метка</translation> + </message> + <message> + <source>(no label)</source> + <translation>(нет метки)</translation> + </message> </context> <context> <name>SendCoinsDialog</name> - </context> + <message> + <source>Bytes:</source> + <translation>Байтов:</translation> + </message> + <message> + <source>Amount:</source> + <translation>Количество:</translation> + </message> + <message> + <source>Fee:</source> + <translation>Комиссия:</translation> + </message> + <message> + <source>Choose...</source> + <translation>Выбрать...</translation> + </message> + <message> + <source>Hide</source> + <translation>Спрятать</translation> + </message> + <message> + <source>Balance:</source> + <translation>Баланс:</translation> + </message> + <message> + <source>Copy amount</source> + <translation>Копировать сумму</translation> + </message> + <message> + <source>(no label)</source> + <translation>(нет метки)</translation> + </message> +</context> <context> <name>SendCoinsEntry</name> </context> <context> <name>SendConfirmationDialog</name> - </context> + <message> + <source>Yes</source> + <translation>Да</translation> + </message> +</context> <context> <name>ShutdownWindow</name> </context> <context> <name>SignVerifyMessageDialog</name> + <message> + <source>Signature</source> + <translation>Подпись</translation> + </message> </context> <context> <name>SplashScreen</name> @@ -213,9 +773,45 @@ </context> <context> <name>TransactionTableModel</name> + <message> + <source>Label</source> + <translation>Метка</translation> + </message> + <message> + <source>(no label)</source> + <translation>(нет метки)</translation> + </message> </context> <context> <name>TransactionView</name> + <message> + <source>Copy address</source> + <translation>Копировать адрес</translation> + </message> + <message> + <source>Copy label</source> + <translation>Копировать метку</translation> + </message> + <message> + <source>Copy amount</source> + <translation>Копировать сумму</translation> + </message> + <message> + <source>Copy transaction ID</source> + <translation>Копировать ID транзакции</translation> + </message> + <message> + <source>Label</source> + <translation>Метка</translation> + </message> + <message> + <source>Address</source> + <translation>Адрес</translation> + </message> + <message> + <source>Exporting Failed</source> + <translation>Экспорт не удался</translation> + </message> </context> <context> <name>UnitDisplayStatusBarControl</name> diff --git a/src/qt/locale/bitcoin_uk.ts b/src/qt/locale/bitcoin_uk.ts index 7126b2e5c1..4cff6bf370 100644 --- a/src/qt/locale/bitcoin_uk.ts +++ b/src/qt/locale/bitcoin_uk.ts @@ -62,6 +62,18 @@ <translation>Адреса отримання</translation> </message> <message> + <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source> + <translation>Це ваші адреси Bitcoin для надсилання платежів. Завжди перевіряйте суму та адресу одержувача перед відправленням монет.</translation> + </message> + <message> + <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source> + <translation>Це ваші адреси Bitcoin для отримання платежів. Для кожної транзакції рекомендується використовувати нову адресу одержувача.</translation> + </message> + <message> + <source>&Copy Address</source> + <translation>&Скопіювати адресу</translation> + </message> + <message> <source>Copy &Label</source> <translation>Зкопіювати&Створити мітку</translation> </message> @@ -93,6 +105,10 @@ <translation>Мітка</translation> </message> <message> + <source>Address</source> + <translation>Адреса</translation> + </message> + <message> <source>(no label)</source> <translation>(немає мітки)</translation> </message> @@ -115,7 +131,95 @@ <source>Repeat new passphrase</source> <translation>Повторіть пароль</translation> </message> - </context> + <message> + <source>Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>ten or more random characters</b>, or <b>eight or more words</b>.</source> + <translation>Введіть нову кодову фразу для гаманця.<br/>Будь ласка, використовуйте кодові фрази що містять <b> щонайменше десять випадкових символів </b> або <b> щонайменше вісім слів </b>.</translation> + </message> + <message> + <source>Encrypt wallet</source> + <translation>Зашифрувати гаманець</translation> + </message> + <message> + <source>This operation needs your wallet passphrase to unlock the wallet.</source> + <translation>Ця операція потребує пароль для розблокування гаманця.</translation> + </message> + <message> + <source>Unlock wallet</source> + <translation>Розблокувати гаманець</translation> + </message> + <message> + <source>This operation needs your wallet passphrase to decrypt the wallet.</source> + <translation>Ця операція потребує пароль для розшифрування гаманця.</translation> + </message> + <message> + <source>Decrypt wallet</source> + <translation>Дешифрувати гаманець</translation> + </message> + <message> + <source>Change passphrase</source> + <translation>Змінити пароль</translation> + </message> + <message> + <source>Enter the old passphrase and new passphrase to the wallet.</source> + <translation>Введіть старий пароль та новий пароль до гаманця.</translation> + </message> + <message> + <source>Confirm wallet encryption</source> + <translation>Підтвердіть шифрування гаманця</translation> + </message> + <message> + <source>Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>!</source> + <translation>УВАГА: Якщо ви зашифруєте гаманець і забудете пароль, ви <b>ВТРАТИТЕ ВСІ СВОЇ БІТКОІНИ</b>!</translation> + </message> + <message> + <source>Are you sure you wish to encrypt your wallet?</source> + <translation>Ви дійсно хочете зашифрувати свій гаманець?</translation> + </message> + <message> + <source>Wallet encrypted</source> + <translation>Гаманець зашифровано</translation> + </message> + <message> + <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source> + <translation>%1 буде закрито зараз, щоб завершити процес шифрування. Пам'ятайте, що шифрування гаманця не може повністю захистити ваші біткойни від крадіжки шкідливими програмами, у випадку якщо ваш комп'ютер буде інфіковано.</translation> + </message> + <message> + <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source> + <translation>ВАЖЛИВО: Всі попередні резервні копії, які ви зробили з вашого файлу гаманця повинні бути замінені новоствореним, зашифрованим файлом гаманця. З міркувань безпеки, попередні резервні копії незашифрованого файла гаманця стануть непридатними одразу ж, як тільки ви почнете використовувати новий, зашифрований гаманець.</translation> + </message> + <message> + <source>Wallet encryption failed</source> + <translation>Не вдалося зашифрувати гаманець</translation> + </message> + <message> + <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> + <translation>Виникла помилка під час шифрування гаманця. Ваш гаманець не було зашифровано.</translation> + </message> + <message> + <source>The supplied passphrases do not match.</source> + <translation>Введені паролі не співпадають.</translation> + </message> + <message> + <source>Wallet unlock failed</source> + <translation>Не вдалося розблокувати гаманець</translation> + </message> + <message> + <source>The passphrase entered for the wallet decryption was incorrect.</source> + <translation>Введений пароль є невірним.</translation> + </message> + <message> + <source>Wallet decryption failed</source> + <translation>Не вдалося розшифрувати гаманець</translation> + </message> + <message> + <source>Wallet passphrase was successfully changed.</source> + <translation>Пароль було успішно змінено.</translation> + </message> + <message> + <source>Warning: The Caps Lock key is on!</source> + <translation>Увага: Ввімкнено Caps Lock!</translation> + </message> +</context> <context> <name>BanTableModel</name> <message> @@ -170,6 +274,10 @@ <translation>П&ро %1</translation> </message> <message> + <source>Show information about %1</source> + <translation>Показати інформацію про %1</translation> + </message> + <message> <source>About &Qt</source> <translation>&Про Qt</translation> </message> @@ -182,6 +290,10 @@ <translation>&Параметри...</translation> </message> <message> + <source>Modify configuration options for %1</source> + <translation>Редагувати параметри для %1</translation> + </message> + <message> <source>&Encrypt Wallet...</source> <translation>&Шифрування гаманця...</translation> </message> @@ -206,6 +318,22 @@ <translation>Відкрити &URI</translation> </message> <message> + <source>Click to disable network activity.</source> + <translation>Натисніть, щоб вимкнути активність мережі.</translation> + </message> + <message> + <source>Network activity disabled.</source> + <translation>Мережева активність вимкнена.</translation> + </message> + <message> + <source>Click to enable network activity again.</source> + <translation>Натисніть, щоб знову активувати мережеву активність.</translation> + </message> + <message> + <source>Syncing Headers (%1%)...</source> + <translation>Синхронізація заголовків (%1%)...</translation> + </message> + <message> <source>Reindexing blocks on disk...</source> <translation>Переіндексація блоків на диску ...</translation> </message> @@ -309,6 +437,14 @@ <source>%n active connection(s) to Bitcoin network</source> <translation><numerusform>%n активне з'єднання з мережею Bitcoin</numerusform><numerusform>%n активні з'єднання з мережею Bitcoin</numerusform><numerusform>%n активних з'єднань з мережею Bitcoin</numerusform></translation> </message> + <message> + <source>Indexing blocks on disk...</source> + <translation>Індексація блоків на диску ...</translation> + </message> + <message> + <source>Processing blocks on disk...</source> + <translation>Обробка блоків на диску...</translation> + </message> <message numerus="yes"> <source>Processed %n block(s) of transaction history.</source> <translation><numerusform>Оброблено %n блок історії транзакцій.</numerusform><numerusform>Оброблено %n блоки історії транзакцій.</numerusform><numerusform>Оброблено %n блоків історії транзакцій.</numerusform></translation> @@ -342,6 +478,18 @@ <translation>Синхронізовано</translation> </message> <message> + <source>Show the %1 help message to get a list with possible Bitcoin command-line options</source> + <translation>Показати довідку %1 для отримання переліку можливих параметрів командного рядка.</translation> + </message> + <message> + <source>%1 client</source> + <translation>%1 клієнт</translation> + </message> + <message> + <source>Connecting to peers...</source> + <translation>Підключення до вузлів...</translation> + </message> + <message> <source>Catching up...</source> <translation>Синхронізується...</translation> </message> @@ -384,6 +532,14 @@ <translation>Отримані транзакції</translation> </message> <message> + <source>HD key generation is <b>enabled</b></source> + <translation>Генерація HD ключа <b>увімкнена</b></translation> + </message> + <message> + <source>HD key generation is <b>disabled</b></source> + <translation>Генерація HD ключа<b>вимкнена</b></translation> + </message> + <message> <source>Wallet is <b>encrypted</b> and currently <b>unlocked</b></source> <translation><b>Зашифрований</b> гаманець <b>розблоковано</b></translation> </message> @@ -391,7 +547,11 @@ <source>Wallet is <b>encrypted</b> and currently <b>locked</b></source> <translation><b>Зашифрований</b> гаманець <b>заблоковано</b></translation> </message> - </context> + <message> + <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source> + <translation>Сталася фатальна помилка. Помилки не сумісні з подальщою роботою. Гаманець буде закрито.</translation> + </message> +</context> <context> <name>CoinControlDialog</name> <message> @@ -463,10 +623,82 @@ <translation>Підтверджені</translation> </message> <message> + <source>Copy address</source> + <translation>Скопіювати адресу</translation> + </message> + <message> + <source>Copy label</source> + <translation>Скопіювати мітку</translation> + </message> + <message> + <source>Copy amount</source> + <translation>Скопіювати суму</translation> + </message> + <message> + <source>Copy transaction ID</source> + <translation>Скопіювати ID транзакції </translation> + </message> + <message> + <source>Lock unspent</source> + <translation>Заблокувати</translation> + </message> + <message> + <source>Unlock unspent</source> + <translation>Розблокувати</translation> + </message> + <message> + <source>Copy quantity</source> + <translation>Скопіювати кількість</translation> + </message> + <message> + <source>Copy fee</source> + <translation>Скопіювати комісію</translation> + </message> + <message> + <source>Copy after fee</source> + <translation>Скопіювати після комісії</translation> + </message> + <message> + <source>Copy bytes</source> + <translation>Скопіювати байти</translation> + </message> + <message> + <source>Copy dust</source> + <translation>Скопіювати інше</translation> + </message> + <message> + <source>Copy change</source> + <translation>Скопіювати решту</translation> + </message> + <message> + <source>(%1 locked)</source> + <translation>(%1 заблоковано)</translation> + </message> + <message> + <source>yes</source> + <translation>так</translation> + </message> + <message> + <source>no</source> + <translation>ні</translation> + </message> + <message> + <source>Can vary +/- %1 satoshi(s) per input.</source> + <translation>Може відрізнятися на +/- %1 сатоші за введені</translation> + </message> + <message> <source>(no label)</source> <translation>немає мітки</translation> </message> - </context> + <message> + <source>change from %1 (%2)</source> + <translation>решта з %1 (%2)</translation> + </message> + <message> + <source>(change)</source> + <translation>(решта)</translation> + </message> +</context> <context> <name>EditAddressDialog</name> <message> @@ -489,7 +721,39 @@ <source>&Address</source> <translation>&Адреса</translation> </message> - </context> + <message> + <source>New receiving address</source> + <translation>Нова адреса для отримання</translation> + </message> + <message> + <source>New sending address</source> + <translation>Нова адреса для відправлення</translation> + </message> + <message> + <source>Edit receiving address</source> + <translation>Редагувати адресу для отримання</translation> + </message> + <message> + <source>Edit sending address</source> + <translation>Редагувати адресу для відправлення</translation> + </message> + <message> + <source>The entered address "%1" is not a valid Bitcoin address.</source> + <translation>Введена адреса "%1" не є адресою в мережі Bitcoin.</translation> + </message> + <message> + <source>The entered address "%1" is already in the address book.</source> + <translation>Введена адреса «%1» вже присутня в адресній книзі.</translation> + </message> + <message> + <source>Could not unlock wallet.</source> + <translation>Неможливо розблокувати гаманець.</translation> + </message> + <message> + <source>New key generation failed.</source> + <translation>Не вдалося згенерувати нові ключі.</translation> + </message> +</context> <context> <name>FreespaceChecker</name> <message> @@ -524,6 +788,10 @@ <translation>(%1-бітний)</translation> </message> <message> + <source>About %1</source> + <translation>Про %1</translation> + </message> + <message> <source>Command-line options</source> <translation>Параметри командного рядка</translation> </message> @@ -559,7 +827,11 @@ <source>Show splash screen on startup (default: %u)</source> <translation>Показувати заставку під час запуску (типово: %u)</translation> </message> - </context> + <message> + <source>Reset all settings changed in the GUI</source> + <translation>Скинути налаштування, які було змінено через графічний інтерфейс користувача</translation> + </message> +</context> <context> <name>Intro</name> <message> @@ -567,6 +839,14 @@ <translation>Вітання</translation> </message> <message> + <source>Welcome to %1.</source> + <translation>Ласкаво просимо до %1.</translation> + </message> + <message> + <source>As this is the first time the program is launched, you can choose where %1 will store its data.</source> + <translation>Оскільки це перший запуск програми, ви можете обрати де %1 буде зберігати дані.</translation> + </message> + <message> <source>Use the default data directory</source> <translation>Використовувати типовий каталог даних</translation> </message> @@ -598,14 +878,50 @@ <translation>Форма</translation> </message> <message> + <source>Recent transactions may not yet be visible, and therefore your wallet's balance might be incorrect. This information will be correct once your wallet has finished synchronizing with the bitcoin network, as detailed below.</source> + <translation>Нещодавні транзакції ще не відображаються, тому баланс вашого гаманця може бути неточним. Ця інформація буде вірною після того, як ваш гаманець завершить синхронізацію з мережею біткойн, врахровуйте показники нижче.</translation> + </message> + <message> + <source>Attempting to spend bitcoins that are affected by not-yet-displayed transactions will not be accepted by the network.</source> + <translation>Спроба видправити біткойни, які ще не відображаються, не буде прийнята мережею.</translation> + </message> + <message> + <source>Number of blocks left</source> + <translation>Залишилося блоків</translation> + </message> + <message> + <source>Unknown...</source> + <translation>Невідомо...</translation> + </message> + <message> <source>Last block time</source> <translation>Час останнього блоку</translation> </message> <message> + <source>Progress</source> + <translation>Прогрес</translation> + </message> + <message> + <source>Progress increase per hour</source> + <translation>Прогрес за годину</translation> + </message> + <message> + <source>calculating...</source> + <translation>рахування...</translation> + </message> + <message> + <source>Estimated time left until synced</source> + <translation>Орієнтовний час до кінця синхронізації</translation> + </message> + <message> <source>Hide</source> <translation>Приховати</translation> </message> - </context> + <message> + <source>Unknown. Syncing Headers (%1)...</source> + <translation>Невідомо. Синхронізація заголовків (%1%)...</translation> + </message> +</context> <context> <name>OpenURIDialog</name> <message> @@ -624,7 +940,11 @@ <source>Select payment request file</source> <translation>Виберіть файл запиту платежу</translation> </message> - </context> + <message> + <source>Select payment request file to open</source> + <translation>Виберіть файл запиту платежу</translation> + </message> +</context> <context> <name>OptionsDialog</name> <message> @@ -636,6 +956,10 @@ <translation>&Головні</translation> </message> <message> + <source>&Start %1 on system login</source> + <translation>&Запускати %1 при вході в систему</translation> + </message> + <message> <source>Size of &database cache</source> <translation>Розмір &кешу бази даних</translation> </message> @@ -772,6 +1096,10 @@ <translation>&Вікно</translation> </message> <message> + <source>Hide tray icon</source> + <translation>Сховати іконку в треї</translation> + </message> + <message> <source>Show only a tray icon after minimizing the window.</source> <translation>Показувати лише іконку в треї після згортання вікна.</translation> </message> @@ -917,6 +1245,14 @@ </context> <context> <name>PaymentServer</name> + <message> + <source>Payment request error</source> + <translation>Помилка запиту платежу</translation> + </message> + <message> + <source>URI handling</source> + <translation>Обробка URI</translation> + </message> </context> <context> <name>PeerTableModel</name> @@ -928,7 +1264,11 @@ <source>Node/Service</source> <translation>Вузол/Сервіс</translation> </message> - </context> + <message> + <source>Ping</source> + <translation>Затримка</translation> + </message> +</context> <context> <name>QObject</name> <message> @@ -974,10 +1314,30 @@ </context> <context> <name>QObject::QObject</name> - </context> + <message> + <source>Error: %1</source> + <translation>Помилка: %1</translation> + </message> +</context> <context> <name>QRImageWidget</name> - </context> + <message> + <source>&Save Image...</source> + <translation>&Зберегти зображення...</translation> + </message> + <message> + <source>&Copy Image</source> + <translation>&Копіювати зображення</translation> + </message> + <message> + <source>Save QR Code</source> + <translation>Зберегти QR-код</translation> + </message> + <message> + <source>PNG Image (*.png)</source> + <translation>Зображення PNG (*.png)</translation> + </message> +</context> <context> <name>RPCConsole</name> <message> @@ -1089,6 +1449,14 @@ <translation>Клієнт користувача</translation> </message> <message> + <source>Decrease font size</source> + <translation>Зменшити розмір шрифту</translation> + </message> + <message> + <source>Increase font size</source> + <translation>Збільшити розмір шрифту</translation> + </message> + <message> <source>Services</source> <translation>Сервіси</translation> </message> @@ -1189,6 +1557,10 @@ <translation>Наберіть <b>help</b> для перегляду доступних команд.</translation> </message> <message> + <source>Network activity disabled</source> + <translation>Мережева активність вимкнена.</translation> + </message> + <message> <source>%1 B</source> <translation>%1 Б</translation> </message> @@ -1307,7 +1679,23 @@ <source>Remove</source> <translation>Вилучити</translation> </message> - </context> + <message> + <source>Copy URI</source> + <translation>Скопіювати адресу</translation> + </message> + <message> + <source>Copy label</source> + <translation>Скопіювати мітку</translation> + </message> + <message> + <source>Copy message</source> + <translation>Скопіювати повідомлення</translation> + </message> + <message> + <source>Copy amount</source> + <translation>Скопіювати суму</translation> + </message> +</context> <context> <name>ReceiveRequestDialog</name> <message> @@ -1327,21 +1715,57 @@ <translation>&Зберегти зображення...</translation> </message> <message> + <source>Payment information</source> + <translation>Інформація про платіж</translation> + </message> + <message> + <source>Address</source> + <translation>Адреса</translation> + </message> + <message> + <source>Amount</source> + <translation>Кількість</translation> + </message> + <message> <source>Label</source> <translation>Мітка</translation> </message> + <message> + <source>Message</source> + <translation>Повідомлення</translation> + </message> </context> <context> <name>RecentRequestsTableModel</name> <message> + <source>Date</source> + <translation>Дата</translation> + </message> + <message> <source>Label</source> <translation>Мітка</translation> </message> <message> + <source>Message</source> + <translation>Повідомлення</translation> + </message> + <message> <source>(no label)</source> <translation>немає мітки</translation> </message> - </context> + <message> + <source>(no message)</source> + <translation>(без повідомлення)</translation> + </message> + <message> + <source>(no amount requested)</source> + <translation>(без суми)</translation> + </message> + <message> + <source>Requested</source> + <translation>Запрошено</translation> + </message> +</context> <context> <name>SendCoinsDialog</name> <message> @@ -1469,6 +1893,10 @@ <translation>Пил:</translation> </message> <message> + <source>Confirmation time target:</source> + <translation>Час підтвердження:</translation> + </message> + <message> <source>Clear &All</source> <translation>Очистити &все</translation> </message> @@ -1485,6 +1913,34 @@ <translation>&Відправити</translation> </message> <message> + <source>Copy quantity</source> + <translation>Скопіювати кількість</translation> + </message> + <message> + <source>Copy amount</source> + <translation>Скопіювати суму</translation> + </message> + <message> + <source>Copy fee</source> + <translation>Скопіювати комісію</translation> + </message> + <message> + <source>Copy after fee</source> + <translation>Скопіювати після комісії</translation> + </message> + <message> + <source>Copy bytes</source> + <translation>Скопіювати байти</translation> + </message> + <message> + <source>Copy dust</source> + <translation>Скопіювати інше</translation> + </message> + <message> + <source>Copy change</source> + <translation>Скопіювати решту</translation> + </message> + <message> <source>(no label)</source> <translation>немає мітки</translation> </message> @@ -1567,10 +2023,18 @@ <source>Memo:</source> <translation>Нотатка:</translation> </message> - </context> + <message> + <source>Enter a label for this address to add it to your address book</source> + <translation>Введіть мітку для цієї адреси для додавання її в адресну книгу</translation> + </message> +</context> <context> <name>SendConfirmationDialog</name> - </context> + <message> + <source>Yes</source> + <translation>Так</translation> + </message> +</context> <context> <name>ShutdownWindow</name> <message> @@ -1664,7 +2128,59 @@ <source>Reset all verify message fields</source> <translation>Скинути всі поля перевірки повідомлення</translation> </message> - </context> + <message> + <source>Click "Sign Message" to generate signature</source> + <translation>Натисніть кнопку «Підписати повідомлення», для отримання підпису</translation> + </message> + <message> + <source>The entered address is invalid.</source> + <translation>Введена адреса не співпадає.</translation> + </message> + <message> + <source>Please check the address and try again.</source> + <translation>Будь ласка, перевірте адресу та спробуйте ще.</translation> + </message> + <message> + <source>The entered address does not refer to a key.</source> + <translation>Введена адреса не відноситься до ключа.</translation> + </message> + <message> + <source>Wallet unlock was cancelled.</source> + <translation>Розблокування гаманця було скасоване.</translation> + </message> + <message> + <source>Private key for the entered address is not available.</source> + <translation>Приватний ключ для введеної адреси недоступний. </translation> + </message> + <message> + <source>Message signing failed.</source> + <translation>Не вдалося підписати повідомлення.</translation> + </message> + <message> + <source>Message signed.</source> + <translation>Повідомлення підписано.</translation> + </message> + <message> + <source>The signature could not be decoded.</source> + <translation>Підпис не можливо декодувати.</translation> + </message> + <message> + <source>Please check the signature and try again.</source> + <translation>Будь ласка, перевірте підпис та спробуйте ще.</translation> + </message> + <message> + <source>The signature did not match the message digest.</source> + <translation>Підпис не збігається з хешем повідомлення.</translation> + </message> + <message> + <source>Message verification failed.</source> + <translation>Не вдалося перевірити повідомлення.</translation> + </message> + <message> + <source>Message verified.</source> + <translation>Повідомлення перевірено.</translation> + </message> +</context> <context> <name>SplashScreen</name> <message> @@ -1681,36 +2197,356 @@ </context> <context> <name>TransactionDesc</name> - </context> + <message> + <source>Open until %1</source> + <translation>Відкрито до %1</translation> + </message> + <message> + <source>Status</source> + <translation>Статут</translation> + </message> + <message> + <source>Date</source> + <translation>Дата</translation> + </message> + <message> + <source>Source</source> + <translation>Джерело</translation> + </message> + <message> + <source>Generated</source> + <translation>Згенеровано</translation> + </message> + <message> + <source>From</source> + <translation>Від</translation> + </message> + <message> + <source>unknown</source> + <translation>невідомо</translation> + </message> + <message> + <source>To</source> + <translation>Отримувач</translation> + </message> + <message> + <source>own address</source> + <translation>Власна адреса</translation> + </message> + <message> + <source>label</source> + <translation>мітка</translation> + </message> + <message> + <source>Credit</source> + <translation>Кредит</translation> + </message> + <message> + <source>not accepted</source> + <translation>не прийнято</translation> + </message> + <message> + <source>Debit</source> + <translation>Дебет</translation> + </message> + <message> + <source>Total debit</source> + <translation>Загальний дебет</translation> + </message> + <message> + <source>Total credit</source> + <translation>Загальний кредит</translation> + </message> + <message> + <source>Transaction fee</source> + <translation>Комісія за транзакцію</translation> + </message> + <message> + <source>Net amount</source> + <translation>Загальна сума</translation> + </message> + <message> + <source>Message</source> + <translation>Повідомлення</translation> + </message> + <message> + <source>Comment</source> + <translation>Коментар</translation> + </message> + <message> + <source>Transaction ID</source> + <translation>ID транзакції</translation> + </message> + <message> + <source>Transaction total size</source> + <translation>Розмір транзакції</translation> + </message> + <message> + <source>Merchant</source> + <translation>Продавець</translation> + </message> + <message> + <source>Transaction</source> + <translation>Транзакція</translation> + </message> + <message> + <source>Inputs</source> + <translation>Входи</translation> + </message> + <message> + <source>Amount</source> + <translation>Кількість</translation> + </message> + <message> + <source>true</source> + <translation>вірний</translation> + </message> + <message> + <source>false</source> + <translation>хибний</translation> + </message> +</context> <context> <name>TransactionDescDialog</name> <message> <source>This pane shows a detailed description of the transaction</source> <translation>Даний діалог показує детальну статистику по вибраній транзакції</translation> </message> - </context> + <message> + <source>Details for %1</source> + <translation>Інформація по %1</translation> + </message> +</context> <context> <name>TransactionTableModel</name> <message> + <source>Date</source> + <translation>Дата</translation> + </message> + <message> + <source>Type</source> + <translation>Тип</translation> + </message> + <message> <source>Label</source> <translation>Мітка</translation> </message> <message> + <source>Open until %1</source> + <translation>Відкрито до %1</translation> + </message> + <message> + <source>Offline</source> + <translation>Поза мережею</translation> + </message> + <message> + <source>Unconfirmed</source> + <translation>Не підтверджено</translation> + </message> + <message> + <source>Abandoned</source> + <translation>Відкинуті</translation> + </message> + <message> + <source>Confirming (%1 of %2 recommended confirmations)</source> + <translation>Підтверджується (%1 з %2 рекомендованих підтверджень)</translation> + </message> + <message> + <source>Confirmed (%1 confirmations)</source> + <translation>Підтверджено (%1 підтверджень)</translation> + </message> + <message> + <source>Conflicted</source> + <translation>Суперечить</translation> + </message> + <message> + <source>Immature (%1 confirmations, will be available after %2)</source> + <translation>Повністтю не підтверджено (%1 підтверджень, будуть доступні після %2)</translation> + </message> + <message> + <source>This block was not received by any other nodes and will probably not be accepted!</source> + <translation>Цей блок не був отриманий жодними іншими вузлами і, ймовірно, не буде прийнятий!</translation> + </message> + <message> + <source>Generated but not accepted</source> + <translation>Згенеровано (не підтверджено)</translation> + </message> + <message> + <source>Received with</source> + <translation>Отримано з</translation> + </message> + <message> + <source>Received from</source> + <translation>Отримано від</translation> + </message> + <message> + <source>Sent to</source> + <translation>Відправлені на</translation> + </message> + <message> + <source>Payment to yourself</source> + <translation>Відправлено собі</translation> + </message> + <message> + <source>Mined</source> + <translation>Добуті</translation> + </message> + <message> <source>(no label)</source> <translation>немає мітки</translation> </message> - </context> + <message> + <source>Transaction status. Hover over this field to show number of confirmations.</source> + <translation>Статус транзакції. Наведіть вказівник на це поле, щоб показати кількість підтверджень.</translation> + </message> + <message> + <source>Date and time that the transaction was received.</source> + <translation>Дата і час, коли транзакцію було отримано.</translation> + </message> + <message> + <source>Type of transaction.</source> + <translation>Тип транзакції.</translation> + </message> + <message> + <source>User-defined intent/purpose of the transaction.</source> + <translation>Визначений користувачем намір чи мета транзакції.</translation> + </message> + <message> + <source>Amount removed from or added to balance.</source> + <translation>Сума, додана чи знята з балансу.</translation> + </message> +</context> <context> <name>TransactionView</name> <message> + <source>All</source> + <translation>Всі</translation> + </message> + <message> + <source>Today</source> + <translation>Сьогодні</translation> + </message> + <message> + <source>This week</source> + <translation>На цьому тижні</translation> + </message> + <message> + <source>This month</source> + <translation>Цього місяця</translation> + </message> + <message> + <source>Last month</source> + <translation>Минулого місяця</translation> + </message> + <message> + <source>This year</source> + <translation>Цього року</translation> + </message> + <message> + <source>Range...</source> + <translation>Діапазон від:</translation> + </message> + <message> + <source>Received with</source> + <translation>Отримано з</translation> + </message> + <message> + <source>Sent to</source> + <translation>Відправлені на</translation> + </message> + <message> + <source>To yourself</source> + <translation>Відправлені собі</translation> + </message> + <message> + <source>Mined</source> + <translation>Добуті</translation> + </message> + <message> + <source>Other</source> + <translation>Інше</translation> + </message> + <message> + <source>Enter address or label to search</source> + <translation>Введіть адресу чи мітку для пошуку</translation> + </message> + <message> + <source>Min amount</source> + <translation>Мінімальна сума</translation> + </message> + <message> + <source>Abandon transaction</source> + <translation>Відмовитися від транзакції</translation> + </message> + <message> + <source>Copy address</source> + <translation>Скопіювати адресу</translation> + </message> + <message> + <source>Copy label</source> + <translation>Скопіювати мітку</translation> + </message> + <message> + <source>Copy amount</source> + <translation>Скопіювати суму</translation> + </message> + <message> + <source>Copy transaction ID</source> + <translation>Скопіювати ID транзакції </translation> + </message> + <message> + <source>Copy raw transaction</source> + <translation>Скопіювати RAW транзакцію</translation> + </message> + <message> + <source>Copy full transaction details</source> + <translation>Скопіювати повні деталі транзакції</translation> + </message> + <message> + <source>Edit label</source> + <translation>Редагувати мітку</translation> + </message> + <message> + <source>Show transaction details</source> + <translation>Показати деталі транзакції</translation> + </message> + <message> + <source>Export Transaction History</source> + <translation>Експортувати історію транзакцій</translation> + </message> + <message> <source>Comma separated file (*.csv)</source> <translation>Файли (*.csv) розділеі комами</translation> </message> <message> + <source>Confirmed</source> + <translation>Підтверджено</translation> + </message> + <message> + <source>Watch-only</source> + <translation>Тільки спостереження:</translation> + </message> + <message> + <source>Date</source> + <translation>Дата</translation> + </message> + <message> + <source>Type</source> + <translation>Тип</translation> + </message> + <message> <source>Label</source> <translation>Мітка</translation> </message> <message> + <source>Address</source> + <translation>Адреса</translation> + </message> + <message> + <source>ID</source> + <translation>Ідентифікатор</translation> + </message> + <message> <source>Exporting Failed</source> <translation>Експортування пройшло не успішно</translation> </message> @@ -1730,7 +2566,35 @@ </context> <context> <name>WalletView</name> - </context> + <message> + <source>&Export</source> + <translation>&Експорт</translation> + </message> + <message> + <source>Export the data in the current tab to a file</source> + <translation>Експортувати дані з поточної вкладки в файл</translation> + </message> + <message> + <source>Backup Wallet</source> + <translation>Зробити резервне копіювання гаманця</translation> + </message> + <message> + <source>Wallet Data (*.dat)</source> + <translation>Данi гаманця (*.dat)</translation> + </message> + <message> + <source>Backup Failed</source> + <translation>Помилка резервного копіювання</translation> + </message> + <message> + <source>Backup Successful</source> + <translation>Резервну копію створено успішно</translation> + </message> + <message> + <source>The wallet data was successfully saved to %1.</source> + <translation>Дані гаманця успішно збережено в %1.</translation> + </message> +</context> <context> <name>bitcoin-core</name> <message> @@ -1834,6 +2698,10 @@ <translation>Параметри з'єднання:</translation> </message> <message> + <source>Copyright (C) %i-%i</source> + <translation>Всі права збережено. %i-%i</translation> + </message> + <message> <source>Corrupted block database detected</source> <translation>Виявлено пошкоджений блок бази даних</translation> </message> @@ -1914,6 +2782,10 @@ <translation>Підключатися тільки до вузлів в мережі <net> (ipv4, ipv6 або onion)</translation> </message> <message> + <source>Print this help message and exit</source> + <translation>Надрукувати це довідкове повідомлення та вийти</translation> + </message> + <message> <source>Print version and exit</source> <translation>Версія для друку і виходу</translation> </message> @@ -1926,6 +2798,10 @@ <translation>Використання скороченого ланцюжка блоків несумісне з параметром -txindex.</translation> </message> <message> + <source>Rewinding blocks...</source> + <translation>Відтворення блоків...</translation> + </message> + <message> <source>Set database cache size in megabytes (%d to %d, default: %d)</source> <translation>Встановити розмір кешу бази даних в мегабайтах (від %d до %d, типово: %d)</translation> </message> @@ -2298,10 +3174,18 @@ <translation>Ретранслювати не-P2SH транзакції з мультипідписом (типово: %u)</translation> </message> <message> + <source>Send transactions with full-RBF opt-in enabled (default: %u)</source> + <translation>Надіслати транзакції з увімкненням full-RBF opt-in (типово: %u)</translation> + </message> + <message> <source>Set key pool size to <n> (default: %u)</source> <translation>Встановити розмір пулу ключів <n> (типово: %u)</translation> </message> <message> + <source>Set maximum BIP141 block weight (default: %d)</source> + <translation>Встановити максимальний розмір блоку BIP141 (за замовчуванням: %d)</translation> + </message> + <message> <source>Set the number of threads to service RPC calls (default: %d)</source> <translation>Встановити число потоків для обслуговування викликів RPC (типово: %d)</translation> </message> @@ -2322,10 +3206,38 @@ <translation>Витрачати непідтверджену решту при відправленні транзакцій (типово: %u)</translation> </message> <message> + <source>Starting network threads...</source> + <translation>Запуск мережевих потоків...</translation> + </message> + <message> + <source>The wallet will avoid paying less than the minimum relay fee.</source> + <translation>Гаманець не не переведе кошти якщо комісія менше мінімальної плати за транзакцію.</translation> + </message> + <message> + <source>This is the minimum transaction fee you pay on every transaction.</source> + <translation>Це мінімальна плата за транзакцію, яку ви сплачуєте за кожну операцію.</translation> + </message> + <message> + <source>This is the transaction fee you will pay if you send a transaction.</source> + <translation>Це транзакційна комісія, яку ви сплатите, якщо будете надсилати транзакцію.</translation> + </message> + <message> <source>Threshold for disconnecting misbehaving peers (default: %u)</source> <translation>Поріг відключення учасників з поганою поведінкою (типово: %u)</translation> </message> <message> + <source>Transaction amounts must not be negative</source> + <translation>Сума транзакції занадто мала (зменьшіть комісію, якщо можливо)</translation> + </message> + <message> + <source>Transaction has too long of a mempool chain</source> + <translation>У транзакції занадто довгий ланцюг</translation> + </message> + <message> + <source>Transaction must have at least one recipient</source> + <translation>У транзакції повинен бути щонайменше один одержувач</translation> + </message> + <message> <source>Unknown network specified in -onlynet: '%s'</source> <translation>Невідома мережа вказана в -onlynet: «%s»</translation> </message> diff --git a/src/random.cpp b/src/random.cpp index b308e8f4a1..e07ef44471 100644 --- a/src/random.cpp +++ b/src/random.cpp @@ -27,9 +27,12 @@ #include <sys/syscall.h> #include <linux/random.h> #endif -#ifdef HAVE_GETENTROPY +#if defined(HAVE_GETENTROPY) || (defined(HAVE_GETENTROPY_RAND) && defined(MAC_OSX)) #include <unistd.h> #endif +#if defined(HAVE_GETENTROPY_RAND) && defined(MAC_OSX) +#include <sys/random.h> +#endif #ifdef HAVE_SYSCTL_ARND #include <sys/sysctl.h> #endif @@ -237,6 +240,15 @@ void GetOSRand(unsigned char *ent32) if (getentropy(ent32, NUM_OS_RANDOM_BYTES) != 0) { RandFailure(); } +#elif defined(HAVE_GETENTROPY_RAND) && defined(MAC_OSX) + // We need a fallback for OSX < 10.12 + if (&getentropy != NULL) { + if (getentropy(ent32, NUM_OS_RANDOM_BYTES) != 0) { + RandFailure(); + } + } else { + GetDevURandom(ent32); + } #elif defined(HAVE_SYSCTL_ARND) /* FreeBSD and similar. It is possible for the call to return less * bytes than requested, so need to read in a loop. diff --git a/src/reverse_iterator.h b/src/reverse_iterator.h index 409f895ce0..46789e5417 100644 --- a/src/reverse_iterator.h +++ b/src/reverse_iterator.h @@ -1,7 +1,7 @@ // Taken from https://gist.github.com/arvidsson/7231973 -#ifndef BITCOIN_REVERSE_ITERATOR_HPP -#define BITCOIN_REVERSE_ITERATOR_HPP +#ifndef BITCOIN_REVERSE_ITERATOR_H +#define BITCOIN_REVERSE_ITERATOR_H /** * Template used for reverse iteration in C++11 range-based for loops. @@ -14,19 +14,19 @@ template <typename T> class reverse_range { - T &x; + T &m_x; public: - reverse_range(T &x) : x(x) {} + reverse_range(T &x) : m_x(x) {} - auto begin() const -> decltype(this->x.rbegin()) + auto begin() const -> decltype(this->m_x.rbegin()) { - return x.rbegin(); + return m_x.rbegin(); } - auto end() const -> decltype(this->x.rend()) + auto end() const -> decltype(this->m_x.rend()) { - return x.rend(); + return m_x.rend(); } }; @@ -36,4 +36,4 @@ reverse_range<T> reverse_iterate(T &x) return reverse_range<T>(x); } -#endif // BITCOIN_REVERSE_ITERATOR_HPP +#endif // BITCOIN_REVERSE_ITERATOR_H diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index d65e107e3c..607262f770 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -962,7 +962,6 @@ UniValue gettxout(const JSONRPCRequest& request) " ,...\n" " ]\n" " },\n" - " \"version\" : n, (numeric) The version\n" " \"coinbase\" : true|false (boolean) Coinbase or not\n" "}\n" diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp index f3c86038a3..cd93919eb5 100644 --- a/src/rpc/misc.cpp +++ b/src/rpc/misc.cpp @@ -6,6 +6,7 @@ #include "base58.h" #include "chain.h" #include "clientversion.h" +#include "core_io.h" #include "init.h" #include "validation.h" #include "httpserver.h" diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp index b4d6795e62..6271e0cc83 100644 --- a/src/rpc/net.cpp +++ b/src/rpc/net.cpp @@ -6,6 +6,7 @@ #include "chainparams.h" #include "clientversion.h" +#include "core_io.h" #include "validation.h" #include "net.h" #include "net_processing.h" diff --git a/src/rpc/server.cpp b/src/rpc/server.cpp index 63e4e9c630..58640d69d6 100644 --- a/src/rpc/server.cpp +++ b/src/rpc/server.cpp @@ -123,16 +123,6 @@ CAmount AmountFromValue(const UniValue& value) return amount; } -UniValue ValueFromAmount(const CAmount& amount) -{ - bool sign = amount < 0; - int64_t n_abs = (sign ? -amount : amount); - int64_t quotient = n_abs / COIN; - int64_t remainder = n_abs % COIN; - return UniValue(UniValue::VNUM, - strprintf("%s%d.%08d", sign ? "-" : "", quotient, remainder)); -} - uint256 ParseHashV(const UniValue& v, std::string strName) { std::string strHex; diff --git a/src/rpc/server.h b/src/rpc/server.h index b20c827727..dd6f763245 100644 --- a/src/rpc/server.h +++ b/src/rpc/server.h @@ -185,7 +185,6 @@ extern std::vector<unsigned char> ParseHexV(const UniValue& v, std::string strNa extern std::vector<unsigned char> ParseHexO(const UniValue& o, std::string strKey); extern CAmount AmountFromValue(const UniValue& value); -extern UniValue ValueFromAmount(const CAmount& amount); extern std::string HelpExampleCli(const std::string& methodname, const std::string& args); extern std::string HelpExampleRpc(const std::string& methodname, const std::string& args); diff --git a/src/test/addrman_tests.cpp b/src/test/addrman_tests.cpp index bc6aef2c11..c53744b495 100644 --- a/src/test/addrman_tests.cpp +++ b/src/test/addrman_tests.cpp @@ -15,9 +15,14 @@ class CAddrManTest : public CAddrMan uint64_t state; public: - CAddrManTest() + CAddrManTest(bool makeDeterministic = true) { state = 1; + + if (makeDeterministic) { + // Set addrman addr placement to be deterministic. + MakeDeterministic(); + } } //! Ensure that bucket placement is always the same for testing purposes. @@ -79,9 +84,6 @@ BOOST_AUTO_TEST_CASE(addrman_simple) { CAddrManTest addrman; - // Set addrman addr placement to be deterministic. - addrman.MakeDeterministic(); - CNetAddr source = ResolveIP("252.2.2.2"); // Test: Does Addrman respond correctly when empty. @@ -131,9 +133,6 @@ BOOST_AUTO_TEST_CASE(addrman_ports) { CAddrManTest addrman; - // Set addrman addr placement to be deterministic. - addrman.MakeDeterministic(); - CNetAddr source = ResolveIP("252.2.2.2"); BOOST_CHECK_EQUAL(addrman.size(), 0); @@ -163,9 +162,6 @@ BOOST_AUTO_TEST_CASE(addrman_select) { CAddrManTest addrman; - // Set addrman addr placement to be deterministic. - addrman.MakeDeterministic(); - CNetAddr source = ResolveIP("252.2.2.2"); // Test: Select from new with 1 addr in new. @@ -225,9 +221,6 @@ BOOST_AUTO_TEST_CASE(addrman_new_collisions) { CAddrManTest addrman; - // Set addrman addr placement to be deterministic. - addrman.MakeDeterministic(); - CNetAddr source = ResolveIP("252.2.2.2"); BOOST_CHECK_EQUAL(addrman.size(), 0); @@ -254,9 +247,6 @@ BOOST_AUTO_TEST_CASE(addrman_tried_collisions) { CAddrManTest addrman; - // Set addrman addr placement to be deterministic. - addrman.MakeDeterministic(); - CNetAddr source = ResolveIP("252.2.2.2"); BOOST_CHECK_EQUAL(addrman.size(), 0); @@ -284,9 +274,6 @@ BOOST_AUTO_TEST_CASE(addrman_find) { CAddrManTest addrman; - // Set addrman addr placement to be deterministic. - addrman.MakeDeterministic(); - BOOST_CHECK_EQUAL(addrman.size(), 0); CAddress addr1 = CAddress(ResolveService("250.1.2.1", 8333), NODE_NONE); @@ -320,9 +307,6 @@ BOOST_AUTO_TEST_CASE(addrman_create) { CAddrManTest addrman; - // Set addrman addr placement to be deterministic. - addrman.MakeDeterministic(); - BOOST_CHECK_EQUAL(addrman.size(), 0); CAddress addr1 = CAddress(ResolveService("250.1.2.1", 8333), NODE_NONE); @@ -343,9 +327,6 @@ BOOST_AUTO_TEST_CASE(addrman_delete) { CAddrManTest addrman; - // Set addrman addr placement to be deterministic. - addrman.MakeDeterministic(); - BOOST_CHECK_EQUAL(addrman.size(), 0); CAddress addr1 = CAddress(ResolveService("250.1.2.1", 8333), NODE_NONE); @@ -366,9 +347,6 @@ BOOST_AUTO_TEST_CASE(addrman_getaddr) { CAddrManTest addrman; - // Set addrman addr placement to be deterministic. - addrman.MakeDeterministic(); - // Test: Sanity check, GetAddr should never return anything if addrman // is empty. BOOST_CHECK_EQUAL(addrman.size(), 0); @@ -430,9 +408,6 @@ BOOST_AUTO_TEST_CASE(caddrinfo_get_tried_bucket) { CAddrManTest addrman; - // Set addrman addr placement to be deterministic. - addrman.MakeDeterministic(); - CAddress addr1 = CAddress(ResolveService("250.1.1.1", 8333), NODE_NONE); CAddress addr2 = CAddress(ResolveService("250.1.1.1", 9999), NODE_NONE); @@ -487,9 +462,6 @@ BOOST_AUTO_TEST_CASE(caddrinfo_get_new_bucket) { CAddrManTest addrman; - // Set addrman addr placement to be deterministic. - addrman.MakeDeterministic(); - CAddress addr1 = CAddress(ResolveService("250.1.2.1", 8333), NODE_NONE); CAddress addr2 = CAddress(ResolveService("250.1.2.1", 9999), NODE_NONE); diff --git a/src/test/rpc_tests.cpp b/src/test/rpc_tests.cpp index 134bd7c609..c6643be7a7 100644 --- a/src/test/rpc_tests.cpp +++ b/src/test/rpc_tests.cpp @@ -6,6 +6,7 @@ #include "rpc/client.h" #include "base58.h" +#include "core_io.h" #include "netbase.h" #include "test/test_bitcoin.h" diff --git a/src/test/test_bitcoin.cpp b/src/test/test_bitcoin.cpp index 545e56983c..e2e0a9668f 100644 --- a/src/test/test_bitcoin.cpp +++ b/src/test/test_bitcoin.cpp @@ -75,7 +75,7 @@ TestingSetup::TestingSetup(const std::string& chainName) : BasicTestingSetup(cha pcoinsdbview = new CCoinsViewDB(1 << 23, true); pcoinsTip = new CCoinsViewCache(pcoinsdbview); if (!LoadGenesisBlock(chainparams)) { - throw std::runtime_error("InitBlockIndex failed."); + throw std::runtime_error("LoadGenesisBlock failed."); } { CValidationState state; diff --git a/src/txdb.cpp b/src/txdb.cpp index fd730c368a..7f7eb65673 100644 --- a/src/txdb.cpp +++ b/src/txdb.cpp @@ -422,5 +422,5 @@ bool CCoinsViewDB::Upgrade() { db.CompactRange({DB_COINS, uint256()}, key); uiInterface.SetProgressBreakAction(std::function<void(void)>()); LogPrintf("[%s].\n", ShutdownRequested() ? "CANCELLED" : "DONE"); - return true; + return !ShutdownRequested(); } diff --git a/src/utilmoneystr.h b/src/utilmoneystr.h index 5839b07344..bc885ee167 100644 --- a/src/utilmoneystr.h +++ b/src/utilmoneystr.h @@ -14,6 +14,9 @@ #include "amount.h" +/* Do not use these functions to represent or parse monetary amounts to or from + * JSON but use AmountFromValue and ValueFromAmount for that. + */ std::string FormatMoney(const CAmount& n); bool ParseMoney(const std::string& str, CAmount& nRet); bool ParseMoney(const char* pszIn, CAmount& nRet); diff --git a/src/validation.cpp b/src/validation.cpp index babf6f1522..0f9f6436d8 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -1863,95 +1863,100 @@ static bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockInd */ bool static FlushStateToDisk(const CChainParams& chainparams, CValidationState &state, FlushStateMode mode, int nManualPruneHeight) { int64_t nMempoolUsage = mempool.DynamicMemoryUsage(); - LOCK2(cs_main, cs_LastBlockFile); + LOCK(cs_main); static int64_t nLastWrite = 0; static int64_t nLastFlush = 0; static int64_t nLastSetChain = 0; std::set<int> setFilesToPrune; bool fFlushForPrune = false; + bool fDoFullFlush = false; + int64_t nNow = 0; try { - if (fPruneMode && (fCheckForPruning || nManualPruneHeight > 0) && !fReindex) { - if (nManualPruneHeight > 0) { - FindFilesToPruneManual(setFilesToPrune, nManualPruneHeight); - } else { - FindFilesToPrune(setFilesToPrune, chainparams.PruneAfterHeight()); - fCheckForPruning = false; - } - if (!setFilesToPrune.empty()) { - fFlushForPrune = true; - if (!fHavePruned) { - pblocktree->WriteFlag("prunedblockfiles", true); - fHavePruned = true; - } - } - } - int64_t nNow = GetTimeMicros(); - // Avoid writing/flushing immediately after startup. - if (nLastWrite == 0) { - nLastWrite = nNow; - } - if (nLastFlush == 0) { - nLastFlush = nNow; - } - if (nLastSetChain == 0) { - nLastSetChain = nNow; - } - int64_t nMempoolSizeMax = GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000; - int64_t cacheSize = pcoinsTip->DynamicMemoryUsage(); - int64_t nTotalSpace = nCoinCacheUsage + std::max<int64_t>(nMempoolSizeMax - nMempoolUsage, 0); - // The cache is large and we're within 10% and 10 MiB of the limit, but we have time now (not in the middle of a block processing). - bool fCacheLarge = mode == FLUSH_STATE_PERIODIC && cacheSize > std::max((9 * nTotalSpace) / 10, nTotalSpace - MAX_BLOCK_COINSDB_USAGE * 1024 * 1024); - // The cache is over the limit, we have to write now. - bool fCacheCritical = mode == FLUSH_STATE_IF_NEEDED && cacheSize > nTotalSpace; - // It's been a while since we wrote the block index to disk. Do this frequently, so we don't need to redownload after a crash. - bool fPeriodicWrite = mode == FLUSH_STATE_PERIODIC && nNow > nLastWrite + (int64_t)DATABASE_WRITE_INTERVAL * 1000000; - // It's been very long since we flushed the cache. Do this infrequently, to optimize cache usage. - bool fPeriodicFlush = mode == FLUSH_STATE_PERIODIC && nNow > nLastFlush + (int64_t)DATABASE_FLUSH_INTERVAL * 1000000; - // Combine all conditions that result in a full cache flush. - bool fDoFullFlush = (mode == FLUSH_STATE_ALWAYS) || fCacheLarge || fCacheCritical || fPeriodicFlush || fFlushForPrune; - // Write blocks and block index to disk. - if (fDoFullFlush || fPeriodicWrite) { - // Depend on nMinDiskSpace to ensure we can write block index - if (!CheckDiskSpace(0)) - return state.Error("out of disk space"); - // First make sure all block and undo data is flushed to disk. - FlushBlockFile(); - // Then update all block file information (which may refer to block and undo files). - { - std::vector<std::pair<int, const CBlockFileInfo*> > vFiles; - vFiles.reserve(setDirtyFileInfo.size()); - for (std::set<int>::iterator it = setDirtyFileInfo.begin(); it != setDirtyFileInfo.end(); ) { - vFiles.push_back(std::make_pair(*it, &vinfoBlockFile[*it])); - setDirtyFileInfo.erase(it++); + { + LOCK(cs_LastBlockFile); + if (fPruneMode && (fCheckForPruning || nManualPruneHeight > 0) && !fReindex) { + if (nManualPruneHeight > 0) { + FindFilesToPruneManual(setFilesToPrune, nManualPruneHeight); + } else { + FindFilesToPrune(setFilesToPrune, chainparams.PruneAfterHeight()); + fCheckForPruning = false; } - std::vector<const CBlockIndex*> vBlocks; - vBlocks.reserve(setDirtyBlockIndex.size()); - for (std::set<CBlockIndex*>::iterator it = setDirtyBlockIndex.begin(); it != setDirtyBlockIndex.end(); ) { - vBlocks.push_back(*it); - setDirtyBlockIndex.erase(it++); + if (!setFilesToPrune.empty()) { + fFlushForPrune = true; + if (!fHavePruned) { + pblocktree->WriteFlag("prunedblockfiles", true); + fHavePruned = true; + } } - if (!pblocktree->WriteBatchSync(vFiles, nLastBlockFile, vBlocks)) { - return AbortNode(state, "Failed to write to block index database"); + } + nNow = GetTimeMicros(); + // Avoid writing/flushing immediately after startup. + if (nLastWrite == 0) { + nLastWrite = nNow; + } + if (nLastFlush == 0) { + nLastFlush = nNow; + } + if (nLastSetChain == 0) { + nLastSetChain = nNow; + } + int64_t nMempoolSizeMax = GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000; + int64_t cacheSize = pcoinsTip->DynamicMemoryUsage(); + int64_t nTotalSpace = nCoinCacheUsage + std::max<int64_t>(nMempoolSizeMax - nMempoolUsage, 0); + // The cache is large and we're within 10% and 10 MiB of the limit, but we have time now (not in the middle of a block processing). + bool fCacheLarge = mode == FLUSH_STATE_PERIODIC && cacheSize > std::max((9 * nTotalSpace) / 10, nTotalSpace - MAX_BLOCK_COINSDB_USAGE * 1024 * 1024); + // The cache is over the limit, we have to write now. + bool fCacheCritical = mode == FLUSH_STATE_IF_NEEDED && cacheSize > nTotalSpace; + // It's been a while since we wrote the block index to disk. Do this frequently, so we don't need to redownload after a crash. + bool fPeriodicWrite = mode == FLUSH_STATE_PERIODIC && nNow > nLastWrite + (int64_t)DATABASE_WRITE_INTERVAL * 1000000; + // It's been very long since we flushed the cache. Do this infrequently, to optimize cache usage. + bool fPeriodicFlush = mode == FLUSH_STATE_PERIODIC && nNow > nLastFlush + (int64_t)DATABASE_FLUSH_INTERVAL * 1000000; + // Combine all conditions that result in a full cache flush. + fDoFullFlush = (mode == FLUSH_STATE_ALWAYS) || fCacheLarge || fCacheCritical || fPeriodicFlush || fFlushForPrune; + // Write blocks and block index to disk. + if (fDoFullFlush || fPeriodicWrite) { + // Depend on nMinDiskSpace to ensure we can write block index + if (!CheckDiskSpace(0)) + return state.Error("out of disk space"); + // First make sure all block and undo data is flushed to disk. + FlushBlockFile(); + // Then update all block file information (which may refer to block and undo files). + { + std::vector<std::pair<int, const CBlockFileInfo*> > vFiles; + vFiles.reserve(setDirtyFileInfo.size()); + for (std::set<int>::iterator it = setDirtyFileInfo.begin(); it != setDirtyFileInfo.end(); ) { + vFiles.push_back(std::make_pair(*it, &vinfoBlockFile[*it])); + setDirtyFileInfo.erase(it++); + } + std::vector<const CBlockIndex*> vBlocks; + vBlocks.reserve(setDirtyBlockIndex.size()); + for (std::set<CBlockIndex*>::iterator it = setDirtyBlockIndex.begin(); it != setDirtyBlockIndex.end(); ) { + vBlocks.push_back(*it); + setDirtyBlockIndex.erase(it++); + } + if (!pblocktree->WriteBatchSync(vFiles, nLastBlockFile, vBlocks)) { + return AbortNode(state, "Failed to write to block index database"); + } } + // Finally remove any pruned files + if (fFlushForPrune) + UnlinkPrunedFiles(setFilesToPrune); + nLastWrite = nNow; + } + // Flush best chain related state. This can only be done if the blocks / block index write was also done. + if (fDoFullFlush) { + // Typical Coin structures on disk are around 48 bytes in size. + // Pushing a new one to the database can cause it to be written + // twice (once in the log, and once in the tables). This is already + // an overestimation, as most will delete an existing entry or + // overwrite one. Still, use a conservative safety factor of 2. + if (!CheckDiskSpace(48 * 2 * 2 * pcoinsTip->GetCacheSize())) + return state.Error("out of disk space"); + // Flush the chainstate (which may refer to block index entries). + if (!pcoinsTip->Flush()) + return AbortNode(state, "Failed to write to coin database"); + nLastFlush = nNow; } - // Finally remove any pruned files - if (fFlushForPrune) - UnlinkPrunedFiles(setFilesToPrune); - nLastWrite = nNow; - } - // Flush best chain related state. This can only be done if the blocks / block index write was also done. - if (fDoFullFlush) { - // Typical Coin structures on disk are around 48 bytes in size. - // Pushing a new one to the database can cause it to be written - // twice (once in the log, and once in the tables). This is already - // an overestimation, as most will delete an existing entry or - // overwrite one. Still, use a conservative safety factor of 2. - if (!CheckDiskSpace(48 * 2 * 2 * pcoinsTip->GetCacheSize())) - return state.Error("out of disk space"); - // Flush the chainstate (which may refer to block index entries). - if (!pcoinsTip->Flush()) - return AbortNode(state, "Failed to write to coin database"); - nLastFlush = nNow; } if (fDoFullFlush || ((mode == FLUSH_STATE_ALWAYS || mode == FLUSH_STATE_PERIODIC) && nNow > nLastSetChain + (int64_t)DATABASE_WRITE_INTERVAL * 1000000)) { // Update best block in wallet (so we can detect restored wallets). @@ -2830,22 +2835,6 @@ bool CheckBlock(const CBlock& block, CValidationState& state, const Consensus::P return true; } -static bool CheckIndexAgainstCheckpoint(const CBlockIndex* pindexPrev, CValidationState& state, const CChainParams& chainparams, const uint256& hash) -{ - if (*pindexPrev->phashBlock == chainparams.GetConsensus().hashGenesisBlock) - return true; - - int nHeight = pindexPrev->nHeight+1; - // Don't accept any forks from the main chain prior to last checkpoint. - // GetLastCheckpoint finds the last checkpoint in MapCheckpoints that's in our - // MapBlockIndex. - CBlockIndex* pcheckpoint = Checkpoints::GetLastCheckpoint(chainparams.Checkpoints()); - if (pcheckpoint && nHeight < pcheckpoint->nHeight) - return state.DoS(100, error("%s: forked chain older than last checkpoint (height %d)", __func__, nHeight), REJECT_CHECKPOINT, "bad-fork-prior-to-checkpoint"); - - return true; -} - bool IsWitnessEnabled(const CBlockIndex* pindexPrev, const Consensus::Params& params) { LOCK(cs_main); @@ -2911,14 +2900,26 @@ std::vector<unsigned char> GenerateCoinbaseCommitment(CBlock& block, const CBloc /** Context-dependent validity checks. * By "context", we mean only the previous block headers, but not the UTXO * set; UTXO-related validity checks are done in ConnectBlock(). */ -static bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& state, const Consensus::Params& consensusParams, const CBlockIndex* pindexPrev, int64_t nAdjustedTime) +static bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& state, const CChainParams& params, const CBlockIndex* pindexPrev, int64_t nAdjustedTime) { assert(pindexPrev != NULL); const int nHeight = pindexPrev->nHeight + 1; + // Check proof of work + const Consensus::Params& consensusParams = params.GetConsensus(); if (block.nBits != GetNextWorkRequired(pindexPrev, &block, consensusParams)) return state.DoS(100, false, REJECT_INVALID, "bad-diffbits", false, "incorrect proof of work"); + // Check against checkpoints + if (fCheckpointsEnabled) { + // Don't accept any forks from the main chain prior to last checkpoint. + // GetLastCheckpoint finds the last checkpoint in MapCheckpoints that's in our + // MapBlockIndex. + CBlockIndex* pcheckpoint = Checkpoints::GetLastCheckpoint(params.Checkpoints()); + if (pcheckpoint && nHeight < pcheckpoint->nHeight) + return state.DoS(100, error("%s: forked chain older than last checkpoint (height %d)", __func__, nHeight), REJECT_CHECKPOINT, "bad-fork-prior-to-checkpoint"); + } + // Check timestamp against prev if (block.GetBlockTime() <= pindexPrev->GetMedianTimePast()) return state.Invalid(false, REJECT_INVALID, "time-too-old", "block's timestamp is too early"); @@ -3049,12 +3050,7 @@ static bool AcceptBlockHeader(const CBlockHeader& block, CValidationState& state pindexPrev = (*mi).second; if (pindexPrev->nStatus & BLOCK_FAILED_MASK) return state.DoS(100, error("%s: prev block invalid", __func__), REJECT_INVALID, "bad-prevblk"); - - assert(pindexPrev); - if (fCheckpointsEnabled && !CheckIndexAgainstCheckpoint(pindexPrev, state, chainparams, hash)) - return error("%s: CheckIndexAgainstCheckpoint(): %s", __func__, state.GetRejectReason().c_str()); - - if (!ContextualCheckBlockHeader(block, state, chainparams.GetConsensus(), pindexPrev, GetAdjustedTime())) + if (!ContextualCheckBlockHeader(block, state, chainparams, pindexPrev, GetAdjustedTime())) return error("%s: Consensus::ContextualCheckBlockHeader: %s, %s", __func__, hash.ToString(), FormatStateMessage(state)); } if (pindex == NULL) @@ -3203,16 +3199,13 @@ bool TestBlockValidity(CValidationState& state, const CChainParams& chainparams, { AssertLockHeld(cs_main); assert(pindexPrev && pindexPrev == chainActive.Tip()); - if (fCheckpointsEnabled && !CheckIndexAgainstCheckpoint(pindexPrev, state, chainparams, block.GetHash())) - return error("%s: CheckIndexAgainstCheckpoint(): %s", __func__, state.GetRejectReason().c_str()); - CCoinsViewCache viewNew(pcoinsTip); CBlockIndex indexDummy(block); indexDummy.pprev = pindexPrev; indexDummy.nHeight = pindexPrev->nHeight + 1; // NOTE: CheckBlockHeader is called by CheckBlock - if (!ContextualCheckBlockHeader(block, state, chainparams.GetConsensus(), pindexPrev, GetAdjustedTime())) + if (!ContextualCheckBlockHeader(block, state, chainparams, pindexPrev, GetAdjustedTime())) return error("%s: Consensus::ContextualCheckBlockHeader: %s", __func__, FormatStateMessage(state)); if (!CheckBlock(block, state, chainparams.GetConsensus(), fCheckPOW, fCheckMerkleRoot)) return error("%s: Consensus::CheckBlock: %s", __func__, FormatStateMessage(state)); @@ -3916,7 +3909,6 @@ bool LoadGenesisBlock(const CChainParams& chainparams) if (mapBlockIndex.count(chainparams.GenesisBlock().GetHash())) return true; - // Only add the genesis block if not reindexing (in which case we reuse the one already on disk) try { CBlock &block = const_cast<CBlock&>(chainparams.GenesisBlock()); // Start new block file diff --git a/src/wallet/rpcdump.cpp b/src/wallet/rpcdump.cpp index 5abf32480a..67c6d9ec64 100644 --- a/src/wallet/rpcdump.cpp +++ b/src/wallet/rpcdump.cpp @@ -619,9 +619,8 @@ UniValue dumpwallet(const JSONRPCRequest& request) throw JSONRPCError(RPC_INVALID_PARAMETER, "Cannot open wallet dump file"); std::map<CTxDestination, int64_t> mapKeyBirth; - std::set<CKeyID> setKeyPool; + const std::map<CKeyID, int64_t>& mapKeyPool = pwallet->GetAllReserveKeys(); pwallet->GetKeyBirthTimes(mapKeyBirth); - pwallet->GetAllReserveKeys(setKeyPool); // sort time/key pairs std::vector<std::pair<int64_t, CKeyID> > vKeyBirth; @@ -666,7 +665,7 @@ UniValue dumpwallet(const JSONRPCRequest& request) file << strprintf("label=%s", EncodeDumpString(pwallet->mapAddressBook[keyid].name)); } else if (keyid == masterKeyID) { file << "hdmaster=1"; - } else if (setKeyPool.count(keyid)) { + } else if (mapKeyPool.count(keyid)) { file << "reserve=1"; } else if (pwallet->mapKeyMetadata[keyid].hdKeypath == "m") { file << "inactivehdmaster=1"; diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index a7c229fa74..057379d8da 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -2589,6 +2589,7 @@ UniValue resendwallettransactions(const JSONRPCRequest& request) "Immediately re-broadcast unconfirmed wallet transactions to all peers.\n" "Intended only for testing; the wallet code periodically re-broadcasts\n" "automatically.\n" + "Returns an RPC error if -walletbroadcast is set to false.\n" "Returns array of transaction ids that were re-broadcast.\n" ); @@ -2597,6 +2598,10 @@ UniValue resendwallettransactions(const JSONRPCRequest& request) LOCK2(cs_main, pwallet->cs_wallet); + if (!pwallet->GetBroadcastTransactions()) { + throw JSONRPCError(RPC_WALLET_ERROR, "Error: Wallet transaction broadcasting is disabled with -walletbroadcast"); + } + std::vector<uint256> txids = pwallet->ResendWalletTransactionsBefore(GetTime(), g_connman.get()); UniValue result(UniValue::VARR); for (const uint256& txid : txids) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index d236b1de3f..8b03421691 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -12,6 +12,7 @@ #include "consensus/consensus.h" #include "consensus/validation.h" #include "fs.h" +#include "init.h" #include "key.h" #include "keystore.h" #include "validation.h" @@ -80,6 +81,38 @@ std::string COutput::ToString() const return strprintf("COutput(%s, %d, %d) [%s]", tx->GetHash().ToString(), i, nDepth, FormatMoney(tx->tx->vout[i].nValue)); } +class CAffectedKeysVisitor : public boost::static_visitor<void> { +private: + const CKeyStore &keystore; + std::vector<CKeyID> &vKeys; + +public: + CAffectedKeysVisitor(const CKeyStore &keystoreIn, std::vector<CKeyID> &vKeysIn) : keystore(keystoreIn), vKeys(vKeysIn) {} + + void Process(const CScript &script) { + txnouttype type; + std::vector<CTxDestination> vDest; + int nRequired; + if (ExtractDestinations(script, type, vDest, nRequired)) { + for (const CTxDestination &dest : vDest) + boost::apply_visitor(*this, dest); + } + } + + void operator()(const CKeyID &keyId) { + if (keystore.HaveKey(keyId)) + vKeys.push_back(keyId); + } + + void operator()(const CScriptID &scriptId) { + CScript script; + if (keystore.GetCScript(scriptId, script)) + Process(script); + } + + void operator()(const CNoDestination &none) {} +}; + const CWalletTx* CWallet::GetWalletTx(const uint256& hash) const { LOCK(cs_wallet); @@ -1021,6 +1054,30 @@ bool CWallet::AddToWalletIfInvolvingMe(const CTransactionRef& ptx, const CBlockI if (fExisted && !fUpdate) return false; if (fExisted || IsMine(tx) || IsFromMe(tx)) { + /* Check if any keys in the wallet keypool that were supposed to be unused + * have appeared in a new transaction. If so, remove those keys from the keypool. + * This can happen when restoring an old wallet backup that does not contain + * the mostly recently created transactions from newer versions of the wallet. + */ + + // loop though all outputs + for (const CTxOut& txout: tx.vout) { + // extract addresses and check if they match with an unused keypool key + std::vector<CKeyID> vAffected; + CAffectedKeysVisitor(*this, vAffected).Process(txout.scriptPubKey); + for (const CKeyID &keyid : vAffected) { + std::map<CKeyID, int64_t>::const_iterator mi = m_pool_key_to_index.find(keyid); + if (mi != m_pool_key_to_index.end()) { + LogPrintf("%s: Detected a used keypool key, mark all keypool key up to this key as used\n", __func__); + MarkReserveKeysAsUsed(mi->second); + + if (!TopUpKeyPool()) { + LogPrintf("%s: Topping up keypool failed (locked wallet)\n", __func__); + } + } + } + } + CWalletTx wtx(this, ptx); // Get merkle branch if transaction was found in a block @@ -1868,6 +1925,7 @@ std::vector<uint256> CWallet::ResendWalletTransactionsBefore(int64_t nTime, CCon std::vector<uint256> result; LOCK(cs_wallet); + // Sort them in chronological order std::multimap<unsigned int, CWalletTx*> mapSorted; for (std::pair<const uint256, CWalletTx>& item : mapWallet) @@ -3049,6 +3107,7 @@ DBErrors CWallet::LoadWallet(bool& fFirstRunRet) LOCK(cs_wallet); setInternalKeyPool.clear(); setExternalKeyPool.clear(); + m_pool_key_to_index.clear(); // Note: can't top-up keypool here, because wallet is locked. // User will be prompted to unlock wallet the next operation // that requires a new key. @@ -3078,6 +3137,7 @@ DBErrors CWallet::ZapSelectTx(std::vector<uint256>& vHashIn, std::vector<uint256 { setInternalKeyPool.clear(); setExternalKeyPool.clear(); + m_pool_key_to_index.clear(); // Note: can't top-up keypool here, because wallet is locked. // User will be prompted to unlock wallet the next operation // that requires a new key. @@ -3104,6 +3164,7 @@ DBErrors CWallet::ZapWalletTx(std::vector<CWalletTx>& vWtx) LOCK(cs_wallet); setInternalKeyPool.clear(); setExternalKeyPool.clear(); + m_pool_key_to_index.clear(); // Note: can't top-up keypool here, because wallet is locked. // User will be prompted to unlock wallet the next operation // that requires a new key. @@ -3198,6 +3259,8 @@ bool CWallet::NewKeyPool() } setExternalKeyPool.clear(); + m_pool_key_to_index.clear(); + if (!TopUpKeyPool()) { return false; } @@ -3212,6 +3275,25 @@ size_t CWallet::KeypoolCountExternalKeys() return setExternalKeyPool.size(); } +void CWallet::LoadKeyPool(int64_t nIndex, const CKeyPool &keypool) +{ + AssertLockHeld(cs_wallet); + if (keypool.fInternal) { + setInternalKeyPool.insert(nIndex); + } else { + setExternalKeyPool.insert(nIndex); + } + m_max_keypool_index = std::max(m_max_keypool_index, nIndex); + m_pool_key_to_index[keypool.vchPubKey.GetID()] = nIndex; + + // If no metadata exists yet, create a default with the pool key's + // creation time. Note that this may be overwritten by actually + // stored metadata for that key later, which is fine. + CKeyID keyid = keypool.vchPubKey.GetID(); + if (mapKeyMetadata.count(keyid) == 0) + mapKeyMetadata[keyid] = CKeyMetadata(keypool.nTime); +} + bool CWallet::TopUpKeyPool(unsigned int kpSize) { { @@ -3248,7 +3330,8 @@ bool CWallet::TopUpKeyPool(unsigned int kpSize) assert(m_max_keypool_index < std::numeric_limits<int64_t>::max()); // How in the hell did you use so many keys? int64_t index = ++m_max_keypool_index; - if (!walletdb.WritePool(index, CKeyPool(GenerateNewKey(walletdb, internal), internal))) { + CPubKey pubkey(GenerateNewKey(walletdb, internal)); + if (!walletdb.WritePool(index, CKeyPool(pubkey, internal))) { throw std::runtime_error(std::string(__func__) + ": writing generated key failed"); } @@ -3257,6 +3340,7 @@ bool CWallet::TopUpKeyPool(unsigned int kpSize) } else { setExternalKeyPool.insert(index); } + m_pool_key_to_index[pubkey.GetID()] = index; } if (missingInternal + missingExternal > 0) { LogPrintf("keypool added %d keys (%d internal), size=%u (%u internal)\n", missingInternal + missingExternal, missingInternal, setInternalKeyPool.size() + setExternalKeyPool.size(), setInternalKeyPool.size()); @@ -3298,6 +3382,7 @@ void CWallet::ReserveKeyFromKeyPool(int64_t& nIndex, CKeyPool& keypool, bool fRe } assert(keypool.vchPubKey.IsValid()); + m_pool_key_to_index.erase(keypool.vchPubKey.GetID()); LogPrintf("keypool reserve %d\n", nIndex); } } @@ -3310,7 +3395,7 @@ void CWallet::KeepKey(int64_t nIndex) LogPrintf("keypool keep %d\n", nIndex); } -void CWallet::ReturnKey(int64_t nIndex, bool fInternal) +void CWallet::ReturnKey(int64_t nIndex, bool fInternal, const CPubKey& pubkey) { // Return to key pool { @@ -3320,6 +3405,7 @@ void CWallet::ReturnKey(int64_t nIndex, bool fInternal) } else { setExternalKeyPool.insert(nIndex); } + m_pool_key_to_index[pubkey.GetID()] = nIndex; } LogPrintf("keypool return %d\n", nIndex); } @@ -3549,41 +3635,39 @@ void CReserveKey::KeepKey() void CReserveKey::ReturnKey() { if (nIndex != -1) { - pwallet->ReturnKey(nIndex, fInternal); + pwallet->ReturnKey(nIndex, fInternal, vchPubKey); } nIndex = -1; vchPubKey = CPubKey(); } -static void LoadReserveKeysToSet(std::set<CKeyID>& setAddress, const std::set<int64_t>& setKeyPool, CWalletDB& walletdb) { - for (const int64_t& id : setKeyPool) - { - CKeyPool keypool; - if (!walletdb.ReadPool(id, keypool)) - throw std::runtime_error(std::string(__func__) + ": read failed"); - assert(keypool.vchPubKey.IsValid()); - CKeyID keyID = keypool.vchPubKey.GetID(); - setAddress.insert(keyID); - } -} - -void CWallet::GetAllReserveKeys(std::set<CKeyID>& setAddress) const +void CWallet::MarkReserveKeysAsUsed(int64_t keypool_id) { - setAddress.clear(); + AssertLockHeld(cs_wallet); + bool internal = setInternalKeyPool.count(keypool_id); + if (!internal) assert(setExternalKeyPool.count(keypool_id)); + std::set<int64_t> *setKeyPool = internal ? &setInternalKeyPool : &setExternalKeyPool; + auto it = setKeyPool->begin(); CWalletDB walletdb(*dbw); + while (it != std::end(*setKeyPool)) { + const int64_t& index = *(it); + if (index > keypool_id) break; // set*KeyPool is ordered - LOCK2(cs_main, cs_wallet); - LoadReserveKeysToSet(setAddress, setInternalKeyPool, walletdb); - LoadReserveKeysToSet(setAddress, setExternalKeyPool, walletdb); - - for (const CKeyID& keyID : setAddress) { - if (!HaveKey(keyID)) { - throw std::runtime_error(std::string(__func__) + ": unknown key in key pool"); + CKeyPool keypool; + if (walletdb.ReadPool(index, keypool)) { //TODO: This should be unnecessary + m_pool_key_to_index.erase(keypool.vchPubKey.GetID()); } + walletdb.ErasePool(index); + it = setKeyPool->erase(it); } } +bool CWallet::HasUnusedKeys(int min_keys) const +{ + return setExternalKeyPool.size() >= min_keys && (setInternalKeyPool.size() >= min_keys || !CanSupportFeature(FEATURE_HD_SPLIT)); +} + void CWallet::GetScriptForMining(std::shared_ptr<CReserveScript> &script) { std::shared_ptr<CReserveKey> rKey = std::make_shared<CReserveKey>(this); @@ -3633,38 +3717,6 @@ void CWallet::ListLockedCoins(std::vector<COutPoint>& vOutpts) const /** @} */ // end of Actions -class CAffectedKeysVisitor : public boost::static_visitor<void> { -private: - const CKeyStore &keystore; - std::vector<CKeyID> &vKeys; - -public: - CAffectedKeysVisitor(const CKeyStore &keystoreIn, std::vector<CKeyID> &vKeysIn) : keystore(keystoreIn), vKeys(vKeysIn) {} - - void Process(const CScript &script) { - txnouttype type; - std::vector<CTxDestination> vDest; - int nRequired; - if (ExtractDestinations(script, type, vDest, nRequired)) { - for (const CTxDestination &dest : vDest) - boost::apply_visitor(*this, dest); - } - } - - void operator()(const CKeyID &keyId) { - if (keystore.HaveKey(keyId)) - vKeys.push_back(keyId); - } - - void operator()(const CScriptID &scriptId) { - CScript script; - if (keystore.GetCScript(scriptId, script)) - Process(script); - } - - void operator()(const CNoDestination &none) {} -}; - void CWallet::GetKeyBirthTimes(std::map<CTxDestination, int64_t> &mapKeyBirth) const { AssertLockHeld(cs_wallet); // mapKeyMetadata mapKeyBirth.clear(); @@ -3989,6 +4041,9 @@ CWallet* CWallet::CreateWalletFromFile(const std::string walletFile) RegisterValidationInterface(walletInstance); + // Try to top up keypool. No-op if the wallet is locked. + walletInstance->TopUpKeyPool(); + CBlockIndex *pindexRescan = chainActive.Genesis(); if (!GetBoolArg("-rescan", false)) { diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index 7ef2e6f1d8..0e26d6cc6a 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -470,6 +470,7 @@ public: int64_t GetTxTime() const; int GetRequestCount() const; + // RelayWalletTransaction may only be called if fBroadcastTransactions! bool RelayWalletTransaction(CConnman* connman); std::set<uint256> GetConflicts() const; @@ -704,6 +705,7 @@ private: std::set<int64_t> setInternalKeyPool; std::set<int64_t> setExternalKeyPool; int64_t m_max_keypool_index; + std::map<CKeyID, int64_t> m_pool_key_to_index; int64_t nTimeFirstKey; @@ -746,22 +748,7 @@ public: } } - void LoadKeyPool(int64_t nIndex, const CKeyPool &keypool) - { - if (keypool.fInternal) { - setInternalKeyPool.insert(nIndex); - } else { - setExternalKeyPool.insert(nIndex); - } - m_max_keypool_index = std::max(m_max_keypool_index, nIndex); - - // If no metadata exists yet, create a default with the pool key's - // creation time. Note that this may be overwritten by actually - // stored metadata for that key later, which is fine. - CKeyID keyid = keypool.vchPubKey.GetID(); - if (mapKeyMetadata.count(keyid) == 0) - mapKeyMetadata[keyid] = CKeyMetadata(keypool.nTime); - } + void LoadKeyPool(int64_t nIndex, const CKeyPool &keypool); // Map from Key ID (for regular keys) or Script ID (for watch-only keys) to // key metadata. @@ -827,7 +814,7 @@ public: const CWalletTx* GetWalletTx(const uint256& hash) const; //! check whether we are allowed to upgrade (or already support) to the named feature - bool CanSupportFeature(enum WalletFeature wf) { AssertLockHeld(cs_wallet); return nWalletMaxVersion >= wf; } + bool CanSupportFeature(enum WalletFeature wf) const { AssertLockHeld(cs_wallet); return nWalletMaxVersion >= wf; } /** * populate vCoins with vector of available COutputs. @@ -937,6 +924,7 @@ public: CBlockIndex* ScanForWalletTransactions(CBlockIndex* pindexStart, bool fUpdate = false); void ReacceptWalletTransactions(); void ResendWalletTransactions(int64_t nBestBlockTime, CConnman* connman) override; + // ResendWalletTransactionsBefore may only be called if fBroadcastTransactions! std::vector<uint256> ResendWalletTransactionsBefore(int64_t nTime, CConnman* connman); CAmount GetBalance() const; CAmount GetUnconfirmedBalance() const; @@ -988,10 +976,16 @@ public: bool TopUpKeyPool(unsigned int kpSize = 0); void ReserveKeyFromKeyPool(int64_t& nIndex, CKeyPool& keypool, bool fRequestedInternal); void KeepKey(int64_t nIndex); - void ReturnKey(int64_t nIndex, bool fInternal); + void ReturnKey(int64_t nIndex, bool fInternal, const CPubKey& pubkey); bool GetKeyFromPool(CPubKey &key, bool internal = false); int64_t GetOldestKeyPoolTime(); - void GetAllReserveKeys(std::set<CKeyID>& setAddress) const; + /** + * Marks all keys in the keypool up to and including reserve_key as used. + */ + void MarkReserveKeysAsUsed(int64_t keypool_id); + const std::map<CKeyID, int64_t>& GetAllReserveKeys() const { return m_pool_key_to_index; } + /** Does the wallet have at least min_keys in the keypool? */ + bool HasUnusedKeys(int min_keys) const; std::set< std::set<CTxDestination> > GetAddressGroupings(); std::map<CTxDestination, CAmount> GetAddressBalances(); |